本文整理匯總了Python中numpy.distutils.core.setup.py方法的典型用法代碼示例。如果您正苦於以下問題:Python setup.py方法的具體用法?Python setup.py怎麽用?Python setup.py使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類numpy.distutils.core.setup
的用法示例。
在下文中一共展示了setup.py方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: check_mathlib
# 需要導入模塊: from numpy.distutils.core import setup [as 別名]
# 或者: from numpy.distutils.core.setup import py [as 別名]
def check_mathlib(config_cmd):
# Testing the C math library
mathlibs = []
mathlibs_choices = [[], ['m'], ['cpml']]
mathlib = os.environ.get('MATHLIB')
if mathlib:
mathlibs_choices.insert(0, mathlib.split(','))
for libs in mathlibs_choices:
if config_cmd.check_func("exp", libraries=libs, decl=True, call=True):
mathlibs = libs
break
else:
raise EnvironmentError("math library missing; rerun "
"setup.py after setting the "
"MATHLIB env variable")
return mathlibs
示例2: build_from_c_and_cpp_files
# 需要導入模塊: from numpy.distutils.core import setup [as 別名]
# 或者: from numpy.distutils.core.setup import py [as 別名]
def build_from_c_and_cpp_files(extensions):
"""Modify the extensions to build from the .c and .cpp files.
This is useful for releases, this way cython is not required to
run python setup.py install.
"""
for extension in extensions:
sources = []
for sfile in extension.sources:
path, ext = os.path.splitext(sfile)
if ext in ('.pyx', '.py'):
if extension.language == 'c++':
ext = '.cpp'
else:
ext = '.c'
sfile = path + ext
sources.append(sfile)
extension.sources = sources
示例3: configuration
# 需要導入模塊: from numpy.distutils.core import setup [as 別名]
# 或者: from numpy.distutils.core.setup import py [as 別名]
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration(PACKAGE_NAME, parent_package, top_path)
config.add_subpackage('__check_build')
# pure python packages
config.add_subpackage('datasets')
config.add_subpackage('datasets/tests')
config.add_subpackage('io')
config.add_subpackage('io/tests')
config.add_subpackage('metrics')
config.add_subpackage('metrics/tests')
config.add_subpackage('utils')
config.add_subpackage('utils/tests')
# packages that have their own setup.py -> cython files
config.add_subpackage('extraction')
return config
示例4: configuration
# 需要導入模塊: from numpy.distutils.core import setup [as 別名]
# 或者: from numpy.distutils.core.setup import py [as 別名]
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
from numpy.distutils.system_info import get_info
import numpy
libraries = []
if os.name == 'posix':
libraries.append('m')
config = Configuration('pulse2percept', parent_package, top_path)
# submodules which do not have their own setup.py
# we must manually add sub-submodules & tests
config.add_subpackage('implants')
config.add_subpackage('implants/tests')
config.add_subpackage('utils')
config.add_subpackage('utils/tests')
config.add_subpackage('percepts')
config.add_subpackage('percepts/tests')
config.add_subpackage('viz')
config.add_subpackage('viz/tests')
config.add_subpackage('datasets')
config.add_subpackage('datasets/tests')
# Submodules which have their own setup.py; e.g., because they use Cython:
config.add_subpackage('models')
config.add_subpackage('stimuli')
# Data directories
config.add_data_dir('datasets/data')
config.add_data_dir('stimuli/data')
# https://cython.readthedocs.io/en/latest/src/userguide/source_files_and_compilation.html#compiler-directives
config.ext_modules = cythonize(config.ext_modules,
compiler_directives={
'language_level': 3, # use Py3 runtime
'boundscheck': False, # no IndexError
'wraparound': False, # no arr[-1]
'initializedcheck': False, # no None
})
return config
示例5: configuration
# 需要導入模塊: from numpy.distutils.core import setup [as 別名]
# 或者: from numpy.distutils.core.setup import py [as 別名]
def configuration(parent_package='', top_path=None):
config = Configuration('f2py', parent_package, top_path)
config.add_data_dir('tests')
config.add_data_files('src/fortranobject.c',
'src/fortranobject.h',
)
config.make_svn_version_py()
def generate_f2py_py(build_dir):
f2py_exe = 'f2py' + os.path.basename(sys.executable)[6:]
if f2py_exe[-4:] == '.exe':
f2py_exe = f2py_exe[:-4] + '.py'
if 'bdist_wininst' in sys.argv and f2py_exe[-3:] != '.py':
f2py_exe = f2py_exe + '.py'
target = os.path.join(build_dir, f2py_exe)
if newer(__file__, target):
log.info('Creating %s', target)
f = open(target, 'w')
f.write(_get_f2py_shebang() + '\n')
mainloc = os.path.join(os.path.dirname(__file__), "__main__.py")
with open(mainloc) as mf:
f.write(mf.read())
f.close()
return target
config.add_scripts(generate_f2py_py)
log.info('F2PY Version %s', config.get_version())
return config
示例6: configuration
# 需要導入模塊: from numpy.distutils.core import setup [as 別名]
# 或者: from numpy.distutils.core.setup import py [as 別名]
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
libs = []
if os.name == 'posix':
libs.append('m')
config = Configuration('pmdarima', parent_package, top_path)
# build utilities
config.add_subpackage('__check_build')
config.add_subpackage('_build_utils')
# submodules that do NOT have their own setup.py. manually add their tests
config.add_subpackage('compat')
config.add_subpackage('compat/tests')
config.add_subpackage('datasets')
config.add_subpackage('datasets/tests')
config.add_subpackage('model_selection')
config.add_subpackage('model_selection/tests')
# the following packages have cython or their own setup.py files.
config.add_subpackage('arima')
config.add_subpackage('preprocessing')
config.add_subpackage('utils')
# add test directory
config.add_subpackage('tests')
# Do cythonization, but only if this is not a release tarball, since the
# C/C++ files are not necessarily forward compatible with future versions
# of python.
if 'sdist' not in sys.argv:
cythonize_extensions(top_path, config)
return config
示例7: configuration
# 需要導入模塊: from numpy.distutils.core import setup [as 別名]
# 或者: from numpy.distutils.core.setup import py [as 別名]
def configuration(parent_package="", top_path=None):
config = Configuration('trees', parent_package, top_path)
# submodules which do not have their own setup.py
config.add_subpackage('attribute_observer')
config.add_subpackage('attribute_test')
config.add_subpackage('nodes')
config.add_subpackage('split_criterion')
return config
示例8: configuration
# 需要導入模塊: from numpy.distutils.core import setup [as 別名]
# 或者: from numpy.distutils.core.setup import py [as 別名]
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('skmultiflow', parent_package, top_path)
# submodules which do not have their own setup.py
config.add_subpackage('anomaly_detection')
config.add_subpackage('bayes')
config.add_subpackage('core')
config.add_subpackage('data')
config.add_subpackage('drift_detection')
config.add_subpackage('evaluation')
config.add_subpackage('meta')
config.add_subpackage('neural_networks')
config.add_subpackage('prototype')
config.add_subpackage('rules')
config.add_subpackage('transform')
config.add_subpackage('trees')
config.add_subpackage('utils')
config.add_subpackage('visualization')
# submodules which have their own setup.py
config.add_subpackage('lazy')
config.add_subpackage('metrics')
# Check if should run cythonize or build from source files
maybe_cythonize_extensions(top_path, config)
return config
########################################################################################################################
# Utilities useful during the build. Based on sklearn._build_utils #
########################################################################################################################
示例9: get_version
# 需要導入模塊: from numpy.distutils.core import setup [as 別名]
# 或者: from numpy.distutils.core.setup import py [as 別名]
def get_version():
"""Obtain the version number"""
import imp
mod = imp.load_source('version', os.path.join(PACKAGE_NAME, 'version.py'))
return mod.__version__