本文整理汇总了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
示例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)
示例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)
示例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)
示例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()
示例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()
示例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()
示例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()
示例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)
示例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.
示例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("************************************************************")
示例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()
示例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)
示例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)
示例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(),
}