当前位置: 首页>>代码示例>>Python>>正文


Python extension.Library方法代码示例

本文整理汇总了Python中setuptools.extension.Library方法的典型用法代码示例。如果您正苦于以下问题:Python extension.Library方法的具体用法?Python extension.Library怎么用?Python extension.Library使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在setuptools.extension的用法示例。


在下文中一共展示了extension.Library方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get_ext_filename

# 需要导入模块: from setuptools import extension [as 别名]
# 或者: from setuptools.extension import Library [as 别名]
def get_ext_filename(self, fullname):
        filename = _build_ext.get_ext_filename(self, fullname)
        if fullname in self.ext_map:
            ext = self.ext_map[fullname]
            use_abi3 = (
                six.PY3
                and getattr(ext, 'py_limited_api')
                and get_abi3_suffix()
            )
            if use_abi3:
                so_ext = _get_config_var_837('EXT_SUFFIX')
                filename = filename[:-len(so_ext)]
                filename = filename + get_abi3_suffix()
            if isinstance(ext, Library):
                fn, ext = os.path.splitext(filename)
                return self.shlib_compiler.library_filename(fn, libtype)
            elif use_stubs and ext._links_to_dynamic:
                d, fn = os.path.split(filename)
                return os.path.join(d, 'dl-' + fn)
        return filename 
开发者ID:sofia-netsurv,项目名称:python-netsurv,代码行数:22,代码来源:build_ext.py

示例2: get_ext_filename

# 需要导入模块: from setuptools import extension [as 别名]
# 或者: from setuptools.extension import Library [as 别名]
def get_ext_filename(self, fullname):
        filename = _build_ext.get_ext_filename(self, fullname)
        if fullname in self.ext_map:
            ext = self.ext_map[fullname]
            use_abi3 = (
                six.PY3
                and getattr(ext, 'py_limited_api')
                and get_abi3_suffix()
            )
            if use_abi3:
                so_ext = get_config_var('EXT_SUFFIX')
                filename = filename[:-len(so_ext)]
                filename = filename + get_abi3_suffix()
            if isinstance(ext, Library):
                fn, ext = os.path.splitext(filename)
                return self.shlib_compiler.library_filename(fn, libtype)
            elif use_stubs and ext._links_to_dynamic:
                d, fn = os.path.split(filename)
                return os.path.join(d, 'dl-' + fn)
        return filename 
开发者ID:ryfeus,项目名称:lambda-packs,代码行数:22,代码来源:build_ext.py

示例3: get_ext_outputs

# 需要导入模块: from setuptools import extension [as 别名]
# 或者: from setuptools.extension import Library [as 别名]
def get_ext_outputs(self):
        """Get a list of relative paths to C extensions in the output distro"""

        all_outputs = []
        ext_outputs = []

        paths = {self.bdist_dir: ''}
        for base, dirs, files in os.walk(self.bdist_dir):
            for filename in files:
                if os.path.splitext(filename)[1].lower() in NATIVE_EXTENSIONS:
                    all_outputs.append(paths[base] + filename)
            for filename in dirs:
                paths[os.path.join(base, filename)] = (paths[base] +
                                                       filename + '/')

        if self.distribution.has_ext_modules():
            build_cmd = self.get_finalized_command('build_ext')
            for ext in build_cmd.extensions:
                if isinstance(ext, Library):
                    continue
                fullname = build_cmd.get_ext_fullname(ext.name)
                filename = build_cmd.get_ext_filename(fullname)
                if not os.path.basename(filename).startswith('dl-'):
                    if os.path.exists(os.path.join(self.bdist_dir, filename)):
                        ext_outputs.append(filename)

        return all_outputs, ext_outputs 
开发者ID:jpush,项目名称:jbox,代码行数:29,代码来源:bdist_egg.py

示例4: get_ext_filename

# 需要导入模块: from setuptools import extension [as 别名]
# 或者: from setuptools.extension import Library [as 别名]
def get_ext_filename(self, fullname):
        filename = _build_ext.get_ext_filename(self, fullname)
        if fullname in self.ext_map:
            ext = self.ext_map[fullname]
            if isinstance(ext, Library):
                fn, ext = os.path.splitext(filename)
                return self.shlib_compiler.library_filename(fn, libtype)
            elif use_stubs and ext._links_to_dynamic:
                d, fn = os.path.split(filename)
                return os.path.join(d, 'dl-' + fn)
        return filename 
开发者ID:jpush,项目名称:jbox,代码行数:13,代码来源:build_ext.py

示例5: finalize_options

# 需要导入模块: from setuptools import extension [as 别名]
# 或者: from setuptools.extension import Library [as 别名]
def finalize_options(self):
        _build_ext.finalize_options(self)
        self.extensions = self.extensions or []
        self.check_extensions_list(self.extensions)
        self.shlibs = [ext for ext in self.extensions
                       if isinstance(ext, Library)]
        if self.shlibs:
            self.setup_shlib_compiler()
        for ext in self.extensions:
            ext._full_name = self.get_ext_fullname(ext.name)
        for ext in self.extensions:
            fullname = ext._full_name
            self.ext_map[fullname] = ext

            # distutils 3.1 will also ask for module names
            # XXX what to do with conflicts?
            self.ext_map[fullname.split('.')[-1]] = ext

            ltd = self.shlibs and self.links_to_dynamic(ext) or False
            ns = ltd and use_stubs and not isinstance(ext, Library)
            ext._links_to_dynamic = ltd
            ext._needs_stub = ns
            filename = ext._file_name = self.get_ext_filename(fullname)
            libdir = os.path.dirname(os.path.join(self.build_lib, filename))
            if ltd and libdir not in ext.library_dirs:
                ext.library_dirs.append(libdir)
            if ltd and use_stubs and os.curdir not in ext.runtime_library_dirs:
                ext.runtime_library_dirs.append(os.curdir) 
开发者ID:jpush,项目名称:jbox,代码行数:30,代码来源:build_ext.py

示例6: get_export_symbols

# 需要导入模块: from setuptools import extension [as 别名]
# 或者: from setuptools.extension import Library [as 别名]
def get_export_symbols(self, ext):
        if isinstance(ext, Library):
            return ext.export_symbols
        return _build_ext.get_export_symbols(self, ext) 
开发者ID:jpush,项目名称:jbox,代码行数:6,代码来源:build_ext.py

示例7: build_extension

# 需要导入模块: from setuptools import extension [as 别名]
# 或者: from setuptools.extension import Library [as 别名]
def build_extension(self, ext):
        ext._convert_pyx_sources_to_lang()
        _compiler = self.compiler
        try:
            if isinstance(ext, Library):
                self.compiler = self.shlib_compiler
            _build_ext.build_extension(self, ext)
            if ext._needs_stub:
                cmd = self.get_finalized_command('build_py').build_lib
                self.write_stub(cmd, ext)
        finally:
            self.compiler = _compiler 
开发者ID:jpush,项目名称:jbox,代码行数:14,代码来源:build_ext.py

示例8: get_ext_outputs

# 需要导入模块: from setuptools import extension [as 别名]
# 或者: from setuptools.extension import Library [as 别名]
def get_ext_outputs(self):
        """Get a list of relative paths to C extensions in the output distro"""

        all_outputs = []
        ext_outputs = []

        paths = {self.bdist_dir:''}
        for base, dirs, files in os.walk(self.bdist_dir):
            for filename in files:
                if os.path.splitext(filename)[1].lower() in NATIVE_EXTENSIONS:
                    all_outputs.append(paths[base]+filename)
            for filename in dirs:
                paths[os.path.join(base,filename)] = paths[base]+filename+'/'

        if self.distribution.has_ext_modules():
            build_cmd = self.get_finalized_command('build_ext')
            for ext in build_cmd.extensions:
                if isinstance(ext,Library):
                    continue
                fullname = build_cmd.get_ext_fullname(ext.name)
                filename = build_cmd.get_ext_filename(fullname)
                if not os.path.basename(filename).startswith('dl-'):
                    if os.path.exists(os.path.join(self.bdist_dir,filename)):
                        ext_outputs.append(filename)

        return all_outputs, ext_outputs 
开发者ID:MayOneUS,项目名称:pledgeservice,代码行数:28,代码来源:bdist_egg.py

示例9: get_ext_filename

# 需要导入模块: from setuptools import extension [as 别名]
# 或者: from setuptools.extension import Library [as 别名]
def get_ext_filename(self, fullname):
        filename = _build_ext.get_ext_filename(self,fullname)
        if fullname in self.ext_map:
            ext = self.ext_map[fullname]
            if isinstance(ext,Library):
                fn, ext = os.path.splitext(filename)
                return self.shlib_compiler.library_filename(fn,libtype)
            elif use_stubs and ext._links_to_dynamic:
                d,fn = os.path.split(filename)
                return os.path.join(d,'dl-'+fn)
        return filename 
开发者ID:MayOneUS,项目名称:pledgeservice,代码行数:13,代码来源:build_ext.py

示例10: finalize_options

# 需要导入模块: from setuptools import extension [as 别名]
# 或者: from setuptools.extension import Library [as 别名]
def finalize_options(self):
        _build_ext.finalize_options(self)
        self.extensions = self.extensions or []
        self.check_extensions_list(self.extensions)
        self.shlibs = [ext for ext in self.extensions
            if isinstance(ext, Library)]
        if self.shlibs:
            self.setup_shlib_compiler()
        for ext in self.extensions:
            ext._full_name = self.get_ext_fullname(ext.name)
        for ext in self.extensions:
            fullname = ext._full_name
            self.ext_map[fullname] = ext

            # distutils 3.1 will also ask for module names
            # XXX what to do with conflicts?
            self.ext_map[fullname.split('.')[-1]] = ext

            ltd = ext._links_to_dynamic = \
                self.shlibs and self.links_to_dynamic(ext) or False
            ext._needs_stub = ltd and use_stubs and not isinstance(ext,Library)
            filename = ext._file_name = self.get_ext_filename(fullname)
            libdir = os.path.dirname(os.path.join(self.build_lib,filename))
            if ltd and libdir not in ext.library_dirs:
                ext.library_dirs.append(libdir)
            if ltd and use_stubs and os.curdir not in ext.runtime_library_dirs:
                ext.runtime_library_dirs.append(os.curdir) 
开发者ID:MayOneUS,项目名称:pledgeservice,代码行数:29,代码来源:build_ext.py

示例11: get_export_symbols

# 需要导入模块: from setuptools import extension [as 别名]
# 或者: from setuptools.extension import Library [as 别名]
def get_export_symbols(self, ext):
        if isinstance(ext,Library):
            return ext.export_symbols
        return _build_ext.get_export_symbols(self,ext) 
开发者ID:MayOneUS,项目名称:pledgeservice,代码行数:6,代码来源:build_ext.py

示例12: build_extension

# 需要导入模块: from setuptools import extension [as 别名]
# 或者: from setuptools.extension import Library [as 别名]
def build_extension(self, ext):
        _compiler = self.compiler
        try:
            if isinstance(ext,Library):
                self.compiler = self.shlib_compiler
            _build_ext.build_extension(self,ext)
            if ext._needs_stub:
                self.write_stub(
                    self.get_finalized_command('build_py').build_lib, ext
                )
        finally:
            self.compiler = _compiler 
开发者ID:MayOneUS,项目名称:pledgeservice,代码行数:14,代码来源:build_ext.py


注:本文中的setuptools.extension.Library方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。