Python setuptools.extension() Examples

The following are 3 code examples of setuptools.extension(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module setuptools , or try the search function .
Example #1
Source File: setup.py    From pykaldi with Apache License 2.0 6 votes vote down vote up
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. 
Example #2
Source File: setup.py    From pykaldi with Apache License 2.0 5 votes vote down vote up
def __init__(self, name):
        setuptools.extension.Extension.__init__(self, name, [])
        self._needs_stub = False 
Example #3
Source File: setup.py    From pykaldi with Apache License 2.0 5 votes vote down vote up
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