當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。