当前位置: 首页>>代码示例>>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;未经允许,请勿转载。