當前位置: 首頁>>代碼示例>>Python>>正文


Python build_ext.run方法代碼示例

本文整理匯總了Python中distutils.command.build_ext.build_ext.run方法的典型用法代碼示例。如果您正苦於以下問題:Python build_ext.run方法的具體用法?Python build_ext.run怎麽用?Python build_ext.run使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在distutils.command.build_ext.build_ext的用法示例。


在下文中一共展示了build_ext.run方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: run

# 需要導入模塊: from distutils.command.build_ext import build_ext [as 別名]
# 或者: from distutils.command.build_ext.build_ext import run [as 別名]
def run(self):
        optional = True
        disabled = True
        for ext in self.extensions:
            with_ext = self.distribution.ext_status(ext)
            if with_ext is None:
                disabled = False
            elif with_ext:
                optional = False
                disabled = False
                break
        if disabled:
            return
        try:
            _build_ext.run(self)
        except DistutilsPlatformError:
            exc = sys.exc_info()[1]
            if optional:
                log.warn(str(exc))
                log.warn("skipping build_ext")
            else:
                raise 
開發者ID:python-poetry,項目名稱:poetry,代碼行數:24,代碼來源:setup.py

示例2: run

# 需要導入模塊: from distutils.command.build_ext import build_ext [as 別名]
# 或者: from distutils.command.build_ext.build_ext import run [as 別名]
def run(self):
        if self.distribution.has_c_libraries():
            build_clib = self.get_finalized_command("build_clib")
            self.include_dirs.append(
                os.path.join(build_clib.build_clib, "include"),
            )
            self.include_dirs.extend(build_clib.build_flags['include_dirs'])

            self.library_dirs.append(
                os.path.join(build_clib.build_clib, "lib"),
            )
            self.library_dirs.extend(build_clib.build_flags['library_dirs'])

            self.define = build_clib.build_flags['define']

        return _build_ext.run(self) 
開發者ID:bitaps-com,項目名稱:pybtc,代碼行數:18,代碼來源:setup.py

示例3: run

# 需要導入模塊: from distutils.command.build_ext import build_ext [as 別名]
# 或者: from distutils.command.build_ext.build_ext import run [as 別名]
def run(self):
        if os.path.exists(os.path.join(os.path.dirname(os.path.abspath(__file__)),"__libdarknet","libdarknet.so")):
            logging.info("removing __libdarknet/libdarknet.so")
            os.remove(os.path.join(os.path.dirname(__file__),"__libdarknet","libdarknet.so"))

        if os.path.exists(os.path.join(os.path.dirname(os.path.abspath(__file__)), "libdarknet.so")):
            logging.info("removing libdarknet.so")
            os.remove(os.path.join(os.path.dirname(os.path.abspath(__file__)),"libdarknet.so"))

        if os.path.exists(os.path.join(os.path.dirname(os.path.abspath(__file__)),"pydarknet.cpp")):
            logging.info("removing pydarknet.cpp")
            os.remove(os.path.join(os.path.dirname(os.path.abspath(__file__)),"pydarknet.cpp"))

        for f in os.listdir(os.path.dirname(os.path.abspath(__file__))):
            if f.startswith("pydarknet.") and f.endswith(".so"):
                logging.info("removing " + f)
                os.remove(os.path.join(os.path.dirname(os.path.abspath(__file__)),f))

        clean.run(self) 
開發者ID:madhawav,項目名稱:YOLO3-4-Py,代碼行數:21,代碼來源:setup.py

示例4: run

# 需要導入模塊: from distutils.command.build_ext import build_ext [as 別名]
# 或者: from distutils.command.build_ext.build_ext import run [as 別名]
def run(self):

        from Cython.Build import cythonize

        if USE_ASAN:
            from Cython.Compiler import Options
            # make asan/valgrind's memory leak results better
            Options.generate_cleanup_code = True

        compiler_directives = {'language_level': 3, 'embedsignature': True}
        if linetrace:
            compiler_directives['linetrace'] = True

        self.extensions = cythonize(self.extensions, compiler_directives=compiler_directives)

        _build_ext.run(self)

        run_setup(os.path.join(os.getcwd(), "setup.py"),
                  ['build_py'] + extra_args) 
開發者ID:piqueserver,項目名稱:piqueserver,代碼行數:21,代碼來源:setup.py

示例5: run

# 需要導入模塊: from distutils.command.build_ext import build_ext [as 別名]
# 或者: from distutils.command.build_ext.build_ext import run [as 別名]
def run(self):
        try:
            build_ext.run(self)
        except (DistutilsPlatformError, FileNotFoundError):
            raise BuildFailed() 
開發者ID:maximdanilchenko,項目名稱:aiochclient,代碼行數:7,代碼來源:setup.py

示例6: run

# 需要導入模塊: from distutils.command.build_ext import build_ext [as 別名]
# 或者: from distutils.command.build_ext.build_ext import run [as 別名]
def run(self):
        try:
            build_ext.run(self)
        except DistutilsPlatformError as e:
            error(e)
            raise BuildFailed() 
開發者ID:zarr-developers,項目名稱:numcodecs,代碼行數:8,代碼來源:setup.py

示例7: run

# 需要導入模塊: from distutils.command.build_ext import build_ext [as 別名]
# 或者: from distutils.command.build_ext.build_ext import run [as 別名]
def run(self):
        try:
            build_ext.run(self)
        except DistutilsPlatformError:
            raise BuildFailed() 
開發者ID:python-poetry,項目名稱:poetry,代碼行數:7,代碼來源:setup.py

示例8: run

# 需要導入模塊: from distutils.command.build_ext import build_ext [as 別名]
# 或者: from distutils.command.build_ext.build_ext import run [as 別名]
def run(self):
        try:
            build_ext.run(self)
        except DistutilsPlatformError:
            traceback.print_exc()
            raise BuildFailed() 
開發者ID:mobiusklein,項目名稱:ms_deisotope,代碼行數:8,代碼來源:setup.py

示例9: run

# 需要導入模塊: from distutils.command.build_ext import build_ext [as 別名]
# 或者: from distutils.command.build_ext.build_ext import run [as 別名]
def run(self):
        self.cmake_build()
        # can't use super() here because
        #  _build_ext is an old style class in 2.7
        _build_ext.run(self) 
開發者ID:symengine,項目名稱:symengine.py,代碼行數:7,代碼來源:setup.py

示例10: munge_command

# 需要導入模塊: from distutils.command.build_ext import build_ext [as 別名]
# 或者: from distutils.command.build_ext.build_ext import run [as 別名]
def munge_command(inputvar, srcext, objextname, cmd):
    cmd = shlex.split(cmd.strip())
    munged = []
    # The first thing on the line will be the compiler itself; throw
    # that out.  Find dummy.srcext and dummy.objext, and substitute
    # appropriate Makefile variable names. Also, determine what objext
    # actually is.
    dummy_srcext = "dummy." + srcext
    objext = None
    for arg in cmd[1:]:
        if arg == dummy_srcext:
            munged.append(inputvar) # either $< or $^, depending
        elif arg.startswith("dummy."):
            munged.append("$@")
            objext = arg[len("dummy."):]
        else:
            if shellquote(arg) != arg:
                raise SystemExit("error: command {!r}: "
                                 "cannot put {!r} into a makefile"
                                 .format(cmd, arg))
            munged.append(arg)

    if not objext:
        raise SystemExit("error: command {!r}: failed to determine {}"
                         .format(cmd, objextname))

    return " ".join(munged), objext

# The easiest way to ensure that we use a properly configured compiler
# is to subclass build_ext, because some of the work for that is only
# done when build_ext.run() is called, grumble. 
開發者ID:ActiveState,項目名稱:code,代碼行數:33,代碼來源:recipe-579016.py

示例11: run

# 需要導入模塊: from distutils.command.build_ext import build_ext [as 別名]
# 或者: from distutils.command.build_ext.build_ext import run [as 別名]
def run(self):
        try:
            build_ext.run(self)
        except (DistutilsPlatformError, FileNotFoundError):
            print("************************************************************")
            print("Cannot compile C accelerator module, use pure python version")
            print("************************************************************") 
開發者ID:sdispater,項目名稱:pendulum,代碼行數:9,代碼來源:build.py

示例12: run

# 需要導入模塊: from distutils.command.build_ext import build_ext [as 別名]
# 或者: from distutils.command.build_ext.build_ext import run [as 別名]
def run(self):
        try:
            build_ext.run(self)
        except DistutilsPlatformError:
            raise BuildExtFailed() 
開發者ID:elastic,項目名稱:apm-agent-python,代碼行數:7,代碼來源:setup.py

示例13: run_tests

# 需要導入模塊: from distutils.command.build_ext import build_ext [as 別名]
# 或者: from distutils.command.build_ext.build_ext import run [as 別名]
def run_tests(self):
        sys.stderr.write(
            "%s%spython setup.py test is deprecated by pypa.  Please invoke "
            "'tox' with no arguments for a basic test run.\n%s"
            % (self.COLOR_SEQ % self.RED, self.BOLD_SEQ, self.RESET_SEQ)
        )
        sys.exit(1) 
開發者ID:sqlalchemy,項目名稱:sqlalchemy,代碼行數:9,代碼來源:setup.py

示例14: run

# 需要導入模塊: from distutils.command.build_ext import build_ext [as 別名]
# 或者: from distutils.command.build_ext.build_ext import run [as 別名]
def run(self):
        # Disabling parallel build for now. It causes issues on multiple
        # platforms with concurrent file access causing odd build errors
        #self.parallel = multiprocessing.cpu_count()
        build_ext.run(self) 
開發者ID:capitalone,項目名稱:giraffez,代碼行數:7,代碼來源:setup.py

示例15: run

# 需要導入模塊: from distutils.command.build_ext import build_ext [as 別名]
# 或者: from distutils.command.build_ext.build_ext import run [as 別名]
def run(self):
        build_ext.run(self)
        build_library_files(self.dry_run)
        # HACK: this makes sure the library file (which is large) is only
        # included in binary builds, not source builds.
        from llvmlite.utils import get_library_files
        self.distribution.package_data = {
            "llvmlite.binding": get_library_files(),
        } 
開發者ID:numba,項目名稱:llvmlite,代碼行數:11,代碼來源:setup.py


注:本文中的distutils.command.build_ext.build_ext.run方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。