Python distutils.command.build_ext.build_ext.build_extensions() Examples

The following are 6 code examples of distutils.command.build_ext.build_ext.build_extensions(). 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 distutils.command.build_ext.build_ext , or try the search function .
Example #1
Source File: setup.py    From neuralcoref with MIT License 6 votes vote down vote up
def build_extensions(self):
        build_ext_options.build_options(self)
        build_ext.build_extensions(self)


# def is_installed(requirement):
#     try:
#         pkg_resources.require(requirement)
#     except pkg_resources.ResolutionError:
#         return False
#     else:
#         return True

# if not is_installed('numpy>=1.11.0') or not is_installed('spacy>=2.1.0'):
#     print(textwrap.dedent("""
#             Error: requirements needs to be installed first.
#             You can install them via:
#             $ pip install -r requirements.txt
#             """), file=sys.stderr)
#     exit(1) 
Example #2
Source File: setup.py    From pyroomacoustics with MIT License 6 votes vote down vote up
def build_extensions(self):
        ct = self.compiler.compiler_type
        opts = self.c_opts.get(ct, [])
        if ct == "unix":
            opts.append('-DVERSION_INFO="%s"' % self.distribution.get_version())
            opts.append(cpp_flag(self.compiler))
            if has_flag(self.compiler, "-fvisibility=hidden"):
                opts.append("-fvisibility=hidden")
        elif ct == "msvc":
            opts.append('/DVERSION_INFO=\\"%s\\"' % self.distribution.get_version())
        for ext in self.extensions:
            if ext.language == "c++":
                ext.extra_compile_args += opts
                ext.extra_link_args += opts
        build_ext.build_extensions(self)


### Build Tools End ### 
Example #3
Source File: setup.py    From python-crfsuite with MIT License 6 votes vote down vote up
def build_extensions(self):
        c = self.compiler

        _compile = c._compile

        def c_compile(obj, src, ext, cc_args, extra_postargs, pp_opts):
            cc_args = cc_args + ['-std=c99'] if src.endswith('.c') else cc_args
            return _compile(obj, src, ext, cc_args, extra_postargs, pp_opts)

        if c.compiler_type == 'unix' and 'gcc' in c.compiler:
            c._compile = c_compile
        elif self.compiler.compiler_type == "msvc":
            if sys.version_info[:2] < (3, 5):
                c.include_dirs.extend(['crfsuite/win32'])
                
        build_ext.build_extensions(self) 
Example #4
Source File: setup.py    From pyq with Apache License 2.0 5 votes vote down vote up
def build_extensions(self):
            self.compiler.initialize()
            self.compiler.compile_options.remove('/MD')
            build_ext.build_extensions(self) 
Example #5
Source File: setup.py    From chainercv with MIT License 5 votes vote down vote up
def build_extensions(self):
        self.check_cython_extensions(self.extensions)

        # Include NumPy
        numpy_incl = pkg_resources.resource_filename('numpy', 'core/include')
        for ext in self.extensions:
            if (hasattr(ext, 'include_dirs') and
                    numpy_incl not in ext.include_dirs):
                ext.include_dirs.append(numpy_incl)
        _build_ext.build_extensions(self) 
Example #6
Source File: setup.py    From pyviennacl-dev with MIT License 5 votes vote down vote up
def build_extensions(self):
        c = self.compiler.compiler_type
        if c in platform_cflags.keys():
            for e in self.extensions:
                e.extra_compile_args = platform_cflags[c]
        if c in platform_ldflags.keys():
            for e in self.extensions:
                e.extra_link_args = platform_ldflags[c]
        if c in platform_libs.keys():
            for e in self.extensions:
                try:
                    e.libraries += platform_libs[c]
                except:
                    e.libraries = platform_libs[c]
        build_ext.build_extensions(self)