本文整理汇总了Python中setuptools.command.build_ext.build_ext.run函数的典型用法代码示例。如果您正苦于以下问题:Python run函数的具体用法?Python run怎么用?Python run使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了run函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run
def run(self):
try:
_build_ext.run(self)
except CompileError:
warn('Failed to build extension modules')
import traceback
print(traceback.format_exc(), file=sys.stderr)
示例2: run
def run(self):
# Import numpy here, only when headers are needed
import numpy
# Add numpy headers to include_dirs
self.include_dirs.append(numpy.get_include())
# Call original build_ext command
build_ext.run(self)
示例3: run
def run(self):
if not self.dry_run:
import numpy
import bohrium_api
for ext in self.extensions:
ext.include_dirs.extend([numpy.get_include(), bohrium_api.get_include()])
setup_build_ext.run(self)
示例4: run
def run(self):
"""Run extension builder."""
if "%x" % sys.maxsize != '7fffffffffffffff':
raise DistutilsPlatformError("%s require 64-bit operating system" %
SETUP_METADATA["packages"])
if "z" not in self.libraries:
zcmd = ['bash', '-c', 'cd ' + ZLIBDIR + ' && ( test Makefile -nt'
' configure || bash ./configure --static ) && make -f '
'Makefile.pic PIC']
spawn(cmd=zcmd, dry_run=self.dry_run)
self.extensions[0].extra_objects.extend(
path_join("third-party", "zlib", bn + ".lo") for bn in [
"adler32", "compress", "crc32", "deflate", "gzclose",
"gzlib", "gzread", "gzwrite", "infback", "inffast",
"inflate", "inftrees", "trees", "uncompr", "zutil"])
if "bz2" not in self.libraries:
bz2cmd = ['bash', '-c', 'cd ' + BZIP2DIR + ' && make -f '
'Makefile-libbz2_so all']
spawn(cmd=bz2cmd, dry_run=self.dry_run)
self.extensions[0].extra_objects.extend(
path_join("third-party", "bzip2", bn + ".o") for bn in [
"blocksort", "huffman", "crctable", "randtable",
"compress", "decompress", "bzlib"])
_build_ext.run(self)
示例5: run
def run(self):
inst_gdal_version = self.get_gdal_config('version')
if inst_gdal_version != GDAL_VERSION:
raise GDALConfigError('Version mismatch %s != %s' % (
inst_gdal_version, GDAL_VERSION))
build_ext.run(self)
示例6: run
def run(self):
# Run others commands
self.run_command("scons")
self.run_command("cmake")
# Add lib_dirs and include_dirs in packages
# Copy the directories containing the files generated
# by scons and the like.
if is_conda_build():
print('Building directly with conda. Skip the bin, include and lib dirs.')
return old_build_ext.run(self)
for d in (self.distribution.lib_dirs,
self.distribution.inc_dirs,
self.distribution.bin_dirs,
# self.distribution.share_dirs,
):
if (not d or self.inplace == 1):
continue
if (not os.path.exists(self.build_lib)):
self.mkpath(self.build_lib)
for (name, dir) in d.items():
copy_data_tree(dir, pj(self.build_lib, name))
return old_build_ext.run(self)
示例7: run
def run(self):
# Bail out if we don't have the Python include files
include_dir = get_python_inc()
if not os.path.isfile(os.path.join(include_dir, "Python.h")):
print("You will need the Python headers to compile this extension.")
sys.exit(1)
# Print a warning if pkg-config is not available or does not know about igraph
if buildcfg.use_pkgconfig:
detected = buildcfg.detect_from_pkgconfig()
else:
detected = False
# Check whether we have already compiled igraph in a previous run.
# If so, it should be found in igraphcore/include and
# igraphcore/lib
if os.path.exists("igraphcore"):
buildcfg.use_built_igraph()
detected = True
# Download and compile igraph if the user did not disable it and
# we do not know the libraries from pkg-config yet
if not detected:
if buildcfg.download_igraph_if_needed and is_unix_like():
detected = buildcfg.download_and_compile_igraph()
if detected:
buildcfg.use_built_igraph()
else:
sys.exit(1)
# Fall back to an educated guess if everything else failed
if not detected:
buildcfg.use_educated_guess()
# Replaces library names with full paths to static libraries
# where possible. libm.a is excluded because it caused problems
# on Sabayon Linux where libm.a is probably not compiled with
# -fPIC
if buildcfg.static_extension:
buildcfg.replace_static_libraries(exclusions=["m"])
# Prints basic build information
buildcfg.print_build_info()
ext = first(extension for extension in self.extensions
if extension.name == "igraph._igraph")
buildcfg.configure(ext)
# Run any pre-build hooks
for hook in buildcfg.pre_build_hooks:
hook(self)
# Run the original build_ext command
build_ext.run(self)
# Run any post-build hooks
for hook in buildcfg.post_build_hooks:
hook(self)
示例8: run
def run(self):
try:
build_ext.run(self)
except Exception:
e = sys.exc_info()[1]
sys.stdout.write('%s\n' % str(e))
warnings.warn(self.warning_message +
"Extension modules" +
"There was an issue with your platform configuration - see above.")
示例9: run
def run(self):
try:
self.generate_c_file()
except DistutilsPlatformError:
if os.path.exists("polycomp/speedups.c"):
print("Found existing C file, ignoring errors.")
else:
raise
build_ext.run(self)
示例10: run
def run(self):
try:
build_ext.run(self)
except Exception as e:
warnings.warn('''
Unable to build speedups module, defaulting to pure Python. Note
that the pure Python version is more than fast enough in most cases
%r
''' % e)
示例11: run
def run(self):
BuildExtCommand.run(self)
# If we are not a light build we want to also execute build_js as
# part of our build_ext pipeline. Because setuptools subclasses
# this thing really oddly we cannot use sub_commands but have to
# manually invoke it here.
if not IS_LIGHT_BUILD:
self.run_command('build_js')
示例12: run
def run(self):
return_code = subprocess.call(['./build_libpg_query.sh'])
if return_code:
sys.stderr.write('''
An error occurred during extension building.
Make sure you have bison and flex installed on your system.
''')
sys.exit(return_code)
build_ext.run(self)
示例13: run
def run(self):
build_ext.run(self)
cmd = [sys.executable, os.path.join(here_dir, 'ffi', 'build.py')]
spawn(cmd, dry_run=self.dry_run)
# HACK: this makes sure the library file (which is large) is only
# included in binary builds, not source builds.
self.distribution.package_data = {
"llvmlite.binding": get_library_files(),
}
示例14: run
def run(self):
build_ext.run(self)
cmd = [sys.executable, os.path.join(here_dir, 'build.py')]
spawn(cmd, dry_run=self.dry_run)
# HACK: this makes sure the library file (which is large) is only
# included in binary builds, not source builds.
self.distribution.package_data = {
"libqemu.binding": ["*.dll", "*.so", "*.dylib"]
}
示例15: run
def run(self):
self._run_config_if_needed()
self._check_prefix_modified()
self._configure_compiler()
log.info('include dirs: %r', self.include_dirs)
log.info('library dirs: %r', self.library_dirs)
_build_ext.run(self)