本文整理汇总了Python中distutils.command.build_ext.build_ext.finalize_options方法的典型用法代码示例。如果您正苦于以下问题:Python build_ext.finalize_options方法的具体用法?Python build_ext.finalize_options怎么用?Python build_ext.finalize_options使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类distutils.command.build_ext.build_ext
的用法示例。
在下文中一共展示了build_ext.finalize_options方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: finalize_options
# 需要导入模块: from distutils.command.build_ext import build_ext [as 别名]
# 或者: from distutils.command.build_ext.build_ext import finalize_options [as 别名]
def finalize_options(self):
if self.parallel:
try:
self.parallel = int(self.parallel)
except ValueError:
raise ValueError("--parallel/-j argument must be an integer")
# Ensure that self.include_dirs and self.distribution.include_dirs
# refer to the same list object. finalize_options will modify
# self.include_dirs, but self.distribution.include_dirs is used
# during the actual build.
# self.include_dirs is None unless paths are specified with
# --include-dirs.
# The include paths will be passed to the compiler in the order:
# numpy paths, --include-dirs paths, Python include path.
if isinstance(self.include_dirs, str):
self.include_dirs = self.include_dirs.split(os.pathsep)
incl_dirs = self.include_dirs or []
if self.distribution.include_dirs is None:
self.distribution.include_dirs = []
self.include_dirs = self.distribution.include_dirs
self.include_dirs.extend(incl_dirs)
old_build_ext.finalize_options(self)
self.set_undefined_options('build', ('parallel', 'parallel'))
示例2: finalize_options
# 需要导入模块: from distutils.command.build_ext import build_ext [as 别名]
# 或者: from distutils.command.build_ext.build_ext import finalize_options [as 别名]
def finalize_options(self):
build_ext.finalize_options(self)
if self.debug:
global DEBUG
DEBUG = True
if sys.version_info.major >= 3 and not self.parallel:
# For Python 2.7, we monkeypatch distutils to have parallel
# builds. If --parallel (or -j) wasn't specified, we want to
# reproduce the same behavior as before, that is, auto-detect the
# number of jobs.
self.parallel = mp_compile.MAX_PROCS
for x in self.feature:
if getattr(self, 'disable_%s' % x):
setattr(self.feature, x, False)
self.feature.required.discard(x)
_dbg('Disabling %s', x)
if getattr(self, 'enable_%s' % x):
raise ValueError(
'Conflicting options: --enable-%s and --disable-%s' %
(x, x))
if getattr(self, 'enable_%s' % x):
_dbg('Requiring %s', x)
self.feature.required.add(x)
示例3: finalize_options
# 需要导入模块: from distutils.command.build_ext import build_ext [as 别名]
# 或者: from distutils.command.build_ext.build_ext import finalize_options [as 别名]
def finalize_options(self):
self.set_undefined_options('config',
('q_home', 'q_home'),
('q_arch', 'q_arch'),
('q_version', 'q_version'))
self.set_undefined_options('build',
('build_base', 'build_base'),
('compiler', 'compiler'),
('debug', 'debug'),
('force', 'force'),
('plat_name', 'plat_name'))
if self.build_lib is None:
self.build_lib = os.path.join(self.build_base,
'qext.' + self.plat_name)
if self.build_temp is None:
self.build_temp = os.path.join(self.build_base,
'temp.' + self.plat_name)
if self.extensions is None:
self.extensions = self.distribution.qext_modules
if self.define is None:
split_version = self.q_version.split('.')
self.define = [('KXVER', split_version[0]),
('KXVER2', split_version[1]), ]
示例4: finalize_options
# 需要导入模块: from distutils.command.build_ext import build_ext [as 别名]
# 或者: from distutils.command.build_ext.build_ext import finalize_options [as 别名]
def finalize_options(self):
# Ensure that self.include_dirs and self.distribution.include_dirs
# refer to the same list object. finalize_options will modify
# self.include_dirs, but self.distribution.include_dirs is used
# during the actual build.
# self.include_dirs is None unless paths are specified with
# --include-dirs.
# The include paths will be passed to the compiler in the order:
# numpy paths, --include-dirs paths, Python include path.
if isinstance(self.include_dirs, str):
self.include_dirs = self.include_dirs.split(os.pathsep)
incl_dirs = self.include_dirs or []
if self.distribution.include_dirs is None:
self.distribution.include_dirs = []
self.include_dirs = self.distribution.include_dirs
self.include_dirs.extend(incl_dirs)
old_build_ext.finalize_options(self)
示例5: finalize_options
# 需要导入模块: from distutils.command.build_ext import build_ext [as 别名]
# 或者: from distutils.command.build_ext.build_ext import finalize_options [as 别名]
def finalize_options (self):
if self.library_dirs is None:
self.library_dirs = []
elif isinstance(self.library_dirs, basestring):
self.library_dirs = self.library_dirs.split(os.pathsep)
self.library_dirs.insert(0, os.path.join(sys.real_prefix, "Libs"))
old_build_ext.finalize_options(self)
示例6: finalize_options
# 需要导入模块: from distutils.command.build_ext import build_ext [as 别名]
# 或者: from distutils.command.build_ext.build_ext import finalize_options [as 别名]
def finalize_options(self):
incl_dirs = self.include_dirs
old_build_ext.finalize_options(self)
if incl_dirs is not None:
self.include_dirs.extend(self.distribution.include_dirs or [])
示例7: finalize_options
# 需要导入模块: from distutils.command.build_ext import build_ext [as 别名]
# 或者: from distutils.command.build_ext.build_ext import finalize_options [as 别名]
def finalize_options(self):
if self.library_dirs is None:
self.library_dirs = []
elif isinstance(self.library_dirs, basestring):
self.library_dirs = self.library_dirs.split(os.pathsep)
self.library_dirs.insert(0, os.path.join(sys.real_prefix, "Libs"))
old_build_ext.finalize_options(self)
示例8: finalize_options
# 需要导入模块: from distutils.command.build_ext import build_ext [as 别名]
# 或者: from distutils.command.build_ext.build_ext import finalize_options [as 别名]
def finalize_options(self):
_build_ext.finalize_options(self)
# The argument parsing will result in self.define being a string, but
# it has to be a list of 2-tuples.
# Multiple symbols can be separated with semi-colons.
self.define = _process_define(self)
cmake_opts.extend(self.define)
if self.symengine_dir:
cmake_opts.extend([('SymEngine_DIR', self.symengine_dir)])
if self.generator:
cmake_generator[0] = self.generator
cmake_build_type[0] = self.build_type