本文整理汇总了Python中setuptools.extension方法的典型用法代码示例。如果您正苦于以下问题:Python setuptools.extension方法的具体用法?Python setuptools.extension怎么用?Python setuptools.extension使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类setuptools
的用法示例。
在下文中一共展示了setuptools.extension方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run_tests
# 需要导入模块: import setuptools [as 别名]
# 或者: from setuptools import extension [as 别名]
def run_tests(self):
from kaldi.cudamatrix import cuda_available
if cuda_available():
from kaldi.cudamatrix import CuDevice
CuDevice.instantiate().set_debug_stride_mode(True)
CuDevice.instantiate().select_gpu_id("yes")
super(test_cuda, self).run_tests()
CuDevice.instantiate().print_profile()
else:
print("CUDA not available. Running tests on CPU.")
super(test_cuda, self).run_tests()
################################################################################
# Setup pykaldi
################################################################################
# We add a 'dummy' extension so that setuptools runs the build_ext step.
示例2: __init__
# 需要导入模块: import setuptools [as 别名]
# 或者: from setuptools import extension [as 别名]
def __init__(self, name):
setuptools.extension.Extension.__init__(self, name, [])
self._needs_stub = False
示例3: get_ext_filename
# 需要导入模块: import setuptools [as 别名]
# 或者: from setuptools import extension [as 别名]
def get_ext_filename(self, fullname):
"""Convert the name of an extension (eg. "foo.bar") into the name
of the file from which it will be loaded (eg. "foo/bar.so"). This
patch overrides platform specific extension suffix with ".so".
"""
ext_path = fullname.split('.')
ext_suffix = '.so'
return os.path.join(*ext_path) + ext_suffix