本文整理汇总了Python中Cython.Build.build_ext方法的典型用法代码示例。如果您正苦于以下问题:Python Build.build_ext方法的具体用法?Python Build.build_ext怎么用?Python Build.build_ext使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cython.Build
的用法示例。
在下文中一共展示了Build.build_ext方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: make_setup
# 需要导入模块: from Cython import Build [as 别名]
# 或者: from Cython.Build import build_ext [as 别名]
def make_setup(**opts):
if 'packages' not in opts:
opts['packages'] = find_packages()
ext_modules_list = opts.pop('ext_modules_list', list())
ext_mod, ext_mod_dict = make_extensions(ext_modules_list, opts['packages'])
opts['ext_modules'] = opts.get('ext_modules', list()) + ext_mod
cmdclass = opts.get('cmdclass', dict())
static_exclude = opts.pop('static_exclude_min', list())
if 'compile' not in cmdclass:
compile_class = get_compile_command(ext_mod_dict)
compile_class.static_exclude = static_exclude
cmdclass.update({"compile": get_compile_command(ext_mod_dict)})
if has_cython:
build_py.exclude = ext_modules_list
install_lib.static_exclude = static_exclude
install_lib.compile_exclude = opts.pop('compile_modules_exclude', list())
cmdclass.update({
'build_ext': _build_ext,
'build_py': build_py,
'install_lib': install_lib
})
if has_sphinx and 'build_sphinx' not in cmdclass:
cmdclass['build_sphinx'] = BuildDoc
cmdclass['githubrelease'] = GithubRelease
opts['cmdclass'] = cmdclass
webpack_path = os.path.join(os.getcwd(), 'webpack.config.js')
if os.path.exists(webpack_path) and is_build and os.environ.get('DONT_YARN', "") != 'true':
yarn_build_command = 'devBuild' if is_develop else 'build'
try:
os.system('yarn install --pure-lockfile')
os.system('yarn ' + yarn_build_command)
except Extension as err:
print(err)
setup(**opts)
########################################################################################
# end block