本文整理汇总了Python中setuptools.command.build_ext.build_ext.finalize_options方法的典型用法代码示例。如果您正苦于以下问题:Python build_ext.finalize_options方法的具体用法?Python build_ext.finalize_options怎么用?Python build_ext.finalize_options使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类setuptools.command.build_ext.build_ext
的用法示例。
在下文中一共展示了build_ext.finalize_options方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: finalize_options
# 需要导入模块: from setuptools.command.build_ext import build_ext [as 别名]
# 或者: from setuptools.command.build_ext.build_ext import finalize_options [as 别名]
def finalize_options(self):
_build_ext.finalize_options(self)
# Prevent numpy from thinking it is still in its setup process:
try:
__builtins__.__NUMPY_SETUP__ = False
except:
try:
# For python 3
import builtins
builtins.__NUMPY_SETUP__ = False
except:
warn("Skipping numpy hack; if installation fails, try installing numpy first")
import numpy
self.include_dirs.append(numpy.get_include())
if numpy.__dict__.get('quaternion') is not None:
from distutils.errors import DistutilsError
raise DistutilsError('The target NumPy already has a quaternion type')
示例2: finalize_options
# 需要导入模块: from setuptools.command.build_ext import build_ext [as 别名]
# 或者: from setuptools.command.build_ext.build_ext import finalize_options [as 别名]
def finalize_options(self):
build_ext.finalize_options(self)
# prevent numpy from thinking it is still in its setup process:
set_builtin('__NUMPY_SETUP__', False)
import numpy as np
self.include_dirs.append(np.get_include())
示例3: finalize_options
# 需要导入模块: from setuptools.command.build_ext import build_ext [as 别名]
# 或者: from setuptools.command.build_ext.build_ext import finalize_options [as 别名]
def finalize_options(self):
build_ext.finalize_options(self)
# Prevent numpy from thinking it is still in its setup process:
# https://docs.python.org/2/library/__builtin__.html#module-__builtin__
if isinstance(__builtins__, dict):
__builtins__["__NUMPY_SETUP__"] = False
else:
__builtins__.__NUMPY_SETUP__ = False
import numpy as np
self.include_dirs.append(np.get_include())
示例4: finalize_options
# 需要导入模块: from setuptools.command.build_ext import build_ext [as 别名]
# 或者: from setuptools.command.build_ext.build_ext import finalize_options [as 别名]
def finalize_options(self):
build.finalize_options(self)
# self.set_undefined_options("build_ext", ("download_dir", "download_dir"))
if self.download_dir:
openfst_tar_gz = os.path.join(self.download_dir, self.openfst_basename)
assert os.path.isfile(openfst_tar_gz), (
"File %s does not exist" % openfst_tar_gz
)
else:
self.download_dir = self.build_temp
示例5: finalize_options
# 需要导入模块: from setuptools.command.build_ext import build_ext [as 别名]
# 或者: from setuptools.command.build_ext.build_ext import finalize_options [as 别名]
def finalize_options(self):
_build_ext.finalize_options(self)
__builtins__.__NUMPY_SETUP__ = False
import numpy
self.include_dirs.append(numpy.get_include())
示例6: finalize_options
# 需要导入模块: from setuptools.command.build_ext import build_ext [as 别名]
# 或者: from setuptools.command.build_ext.build_ext import finalize_options [as 别名]
def finalize_options(self):
build_ext.finalize_options(self)
# Prevent numpy from thinking it is still in its setup process:
__builtins__.__NUMPY_SETUP__ = False
import numpy
self.include_dirs.append(numpy.get_include())
示例7: my_build_ext
# 需要导入模块: from setuptools.command.build_ext import build_ext [as 别名]
# 或者: from setuptools.command.build_ext.build_ext import finalize_options [as 别名]
def my_build_ext(pars):
# import delayed:
from setuptools.command.build_ext import build_ext as _build_ext
class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_options(self)
# Prevent numpy from thinking it is still in its setup process:
__builtins__.__NUMPY_SETUP__ = False
import numpy
self.include_dirs.append(numpy.get_include())
#object returned:
return build_ext(pars)
示例8: finalize_options
# 需要导入模块: from setuptools.command.build_ext import build_ext [as 别名]
# 或者: from setuptools.command.build_ext.build_ext import finalize_options [as 别名]
def finalize_options(self):
_build_ext.finalize_options(self)
# Prevent numpy from thinking it is still in its setup process:
__builtins__.__NUMPY_SETUP__ = False
import numpy
self.include_dirs.append(numpy.get_include())
示例9: finalize_options
# 需要导入模块: from setuptools.command.build_ext import build_ext [as 别名]
# 或者: from setuptools.command.build_ext.build_ext import finalize_options [as 别名]
def finalize_options(self):
_build_ext.finalize_options(self)
# Prevent numpy from thinking it is still in its setup process:
__builtins__.__NUMPY_SETUP__ = False
import numpy
self.include_dirs.append(numpy.get_include())
# check whether user has Cython
示例10: finalize_options
# 需要导入模块: from setuptools.command.build_ext import build_ext [as 别名]
# 或者: from setuptools.command.build_ext.build_ext import finalize_options [as 别名]
def finalize_options(self):
build_ext.finalize_options(self)
import builtins
# Prevent numpy from thinking it is still in its setup process:
builtins.__NUMPY_SETUP__ = False
import numpy
self.include_dirs.append(numpy.get_include())
示例11: finalize_options
# 需要导入模块: from setuptools.command.build_ext import build_ext [as 别名]
# 或者: from setuptools.command.build_ext.build_ext import finalize_options [as 别名]
def finalize_options(self):
_build_ext.finalize_options(self)
# Prevent numpy from thinking it is still in its setup process:
__builtins__.__NUMPY_SETUP__ = False
import numpy
self.include_dirs.append(numpy.get_include())
示例12: finalize_options
# 需要导入模块: from setuptools.command.build_ext import build_ext [as 别名]
# 或者: from setuptools.command.build_ext.build_ext import finalize_options [as 别名]
def finalize_options(self):
_build_ext.finalize_options(self)
# Fix to work with bootstrapped numpy installation
# http://stackoverflow.com/a/21621689/579416
# Prevent numpy from thinking it is still in its setup process:
__builtins__.__NUMPY_SETUP__ = False
import numpy
self.include_dirs.append(numpy.get_include())
示例13: finalize_options
# 需要导入模块: from setuptools.command.build_ext import build_ext [as 别名]
# 或者: from setuptools.command.build_ext.build_ext import finalize_options [as 别名]
def finalize_options(self):
'''
In order to avoid premature import of numpy before it gets installed as a dependency
get numpy include directories during the extensions building process
http://stackoverflow.com/questions/19919905/how-to-bootstrap-numpy-installation-in-setup-py
'''
build_ext.finalize_options(self)
# Prevent numpy from thinking it is still in its setup process:
set_builtin('__NUMPY_SETUP__', False)
import numpy
self.include_dirs.append(numpy.get_include())
示例14: finalize_options
# 需要导入模块: from setuptools.command.build_ext import build_ext [as 别名]
# 或者: from setuptools.command.build_ext.build_ext import finalize_options [as 别名]
def finalize_options(self):
build_ext.finalize_options(self)
# Prevent numpy from thinking it is still in its setup process:
# __builtins__.__NUMPY_SETUP__ = False
import numpy
self.include_dirs.append(numpy.get_include())
示例15: finalize_options
# 需要导入模块: from setuptools.command.build_ext import build_ext [as 别名]
# 或者: from setuptools.command.build_ext.build_ext import finalize_options [as 别名]
def finalize_options(self):
build_ext.finalize_options(self)
is_windows = platform.system() == 'Windows'
is_py2 = sys.version_info[0] < 3
is_py34 = sys.version_info[:2] == (3, 4)
if self.compiler is None and is_windows and (is_py2 or is_py34):
self.compiler = 'mingw32'