當前位置: 首頁>>代碼示例>>Python>>正文


Python build_ext.build_extensions方法代碼示例

本文整理匯總了Python中distutils.command.build_ext.build_ext.build_extensions方法的典型用法代碼示例。如果您正苦於以下問題:Python build_ext.build_extensions方法的具體用法?Python build_ext.build_extensions怎麽用?Python build_ext.build_extensions使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在distutils.command.build_ext.build_ext的用法示例。


在下文中一共展示了build_ext.build_extensions方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: build_extensions

# 需要導入模塊: from distutils.command.build_ext import build_ext [as 別名]
# 或者: from distutils.command.build_ext.build_ext import build_extensions [as 別名]
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) 
開發者ID:huggingface,項目名稱:neuralcoref,代碼行數:22,代碼來源:setup.py

示例2: build_extensions

# 需要導入模塊: from distutils.command.build_ext import build_ext [as 別名]
# 或者: from distutils.command.build_ext.build_ext import build_extensions [as 別名]
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 ### 
開發者ID:LCAV,項目名稱:pyroomacoustics,代碼行數:20,代碼來源:setup.py

示例3: build_extensions

# 需要導入模塊: from distutils.command.build_ext import build_ext [as 別名]
# 或者: from distutils.command.build_ext.build_ext import build_extensions [as 別名]
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) 
開發者ID:scrapinghub,項目名稱:python-crfsuite,代碼行數:18,代碼來源:setup.py

示例4: build_extensions

# 需要導入模塊: from distutils.command.build_ext import build_ext [as 別名]
# 或者: from distutils.command.build_ext.build_ext import build_extensions [as 別名]
def build_extensions(self):
            self.compiler.initialize()
            self.compiler.compile_options.remove('/MD')
            build_ext.build_extensions(self) 
開發者ID:KxSystems,項目名稱:pyq,代碼行數:6,代碼來源:setup.py

示例5: build_extensions

# 需要導入模塊: from distutils.command.build_ext import build_ext [as 別名]
# 或者: from distutils.command.build_ext.build_ext import build_extensions [as 別名]
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) 
開發者ID:chainer,項目名稱:chainercv,代碼行數:12,代碼來源:setup.py

示例6: build_extensions

# 需要導入模塊: from distutils.command.build_ext import build_ext [as 別名]
# 或者: from distutils.command.build_ext.build_ext import build_extensions [as 別名]
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) 
開發者ID:viennacl,項目名稱:pyviennacl-dev,代碼行數:17,代碼來源:setup.py


注:本文中的distutils.command.build_ext.build_ext.build_extensions方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。