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


Python _CONFIG_VARS.copy方法代碼示例

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


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

示例1: copy_extensions_to_source

# 需要導入模塊: from sysconfig import _CONFIG_VARS [as 別名]
# 或者: from sysconfig._CONFIG_VARS import copy [as 別名]
def copy_extensions_to_source(self):
        build_py = self.get_finalized_command('build_py')
        for ext in self.extensions:
            fullname = self.get_ext_fullname(ext.name)
            filename = self.get_ext_filename(fullname)
            modpath = fullname.split('.')
            package = '.'.join(modpath[:-1])
            package_dir = build_py.get_package_dir(package)
            dest_filename = os.path.join(package_dir,
                                         os.path.basename(filename))
            src_filename = os.path.join(self.build_lib, filename)

            # Always copy, even if source is older than destination, to ensure
            # that the right extensions for the current Python/platform are
            # used.
            copy_file(
                src_filename, dest_filename, verbose=self.verbose,
                dry_run=self.dry_run
            )
            if ext._needs_stub:
                self.write_stub(package_dir or os.curdir, ext, True) 
開發者ID:jpush,項目名稱:jbox,代碼行數:23,代碼來源:build_ext.py

示例2: copy_extensions_to_source

# 需要導入模塊: from sysconfig import _CONFIG_VARS [as 別名]
# 或者: from sysconfig._CONFIG_VARS import copy [as 別名]
def copy_extensions_to_source(self):
        build_py = self.get_finalized_command('build_py')
        for ext in self.extensions:
            fullname = self.get_ext_fullname(ext.name)
            filename = self.get_ext_filename(fullname)
            modpath = fullname.split('.')
            package = '.'.join(modpath[:-1])
            package_dir = build_py.get_package_dir(package)
            dest_filename = os.path.join(package_dir,os.path.basename(filename))
            src_filename = os.path.join(self.build_lib,filename)

            # Always copy, even if source is older than destination, to ensure
            # that the right extensions for the current Python/platform are
            # used.
            copy_file(
                src_filename, dest_filename, verbose=self.verbose,
                dry_run=self.dry_run
            )
            if ext._needs_stub:
                self.write_stub(package_dir or os.curdir, ext, True) 
開發者ID:MayOneUS,項目名稱:pledgeservice,代碼行數:22,代碼來源:build_ext.py

示例3: run

# 需要導入模塊: from sysconfig import _CONFIG_VARS [as 別名]
# 或者: from sysconfig._CONFIG_VARS import copy [as 別名]
def run(self):
        """Build extensions in build directory, then copy if --inplace"""
        old_inplace, self.inplace = self.inplace, 0
        _build_ext.run(self)
        self.inplace = old_inplace
        if old_inplace:
            self.copy_extensions_to_source() 
開發者ID:jpush,項目名稱:jbox,代碼行數:9,代碼來源:build_ext.py

示例4: setup_shlib_compiler

# 需要導入模塊: from sysconfig import _CONFIG_VARS [as 別名]
# 或者: from sysconfig._CONFIG_VARS import copy [as 別名]
def setup_shlib_compiler(self):
        compiler = self.shlib_compiler = new_compiler(
            compiler=self.compiler, dry_run=self.dry_run, force=self.force
        )
        if sys.platform == "darwin":
            tmp = _CONFIG_VARS.copy()
            try:
                # XXX Help!  I don't have any idea whether these are right...
                _CONFIG_VARS['LDSHARED'] = (
                    "gcc -Wl,-x -dynamiclib -undefined dynamic_lookup")
                _CONFIG_VARS['CCSHARED'] = " -dynamiclib"
                _CONFIG_VARS['SO'] = ".dylib"
                customize_compiler(compiler)
            finally:
                _CONFIG_VARS.clear()
                _CONFIG_VARS.update(tmp)
        else:
            customize_compiler(compiler)

        if self.include_dirs is not None:
            compiler.set_include_dirs(self.include_dirs)
        if self.define is not None:
            # 'define' option is a list of (name,value) tuples
            for (name, value) in self.define:
                compiler.define_macro(name, value)
        if self.undef is not None:
            for macro in self.undef:
                compiler.undefine_macro(macro)
        if self.libraries is not None:
            compiler.set_libraries(self.libraries)
        if self.library_dirs is not None:
            compiler.set_library_dirs(self.library_dirs)
        if self.rpath is not None:
            compiler.set_runtime_library_dirs(self.rpath)
        if self.link_objects is not None:
            compiler.set_link_objects(self.link_objects)

        # hack so distutils' build_extension() builds a library instead
        compiler.link_shared_object = link_shared_object.__get__(compiler) 
開發者ID:jpush,項目名稱:jbox,代碼行數:41,代碼來源:build_ext.py

示例5: setup_shlib_compiler

# 需要導入模塊: from sysconfig import _CONFIG_VARS [as 別名]
# 或者: from sysconfig._CONFIG_VARS import copy [as 別名]
def setup_shlib_compiler(self):
        compiler = self.shlib_compiler = new_compiler(
            compiler=self.compiler, dry_run=self.dry_run, force=self.force
        )
        if sys.platform == "darwin":
            tmp = _CONFIG_VARS.copy()
            try:
                # XXX Help!  I don't have any idea whether these are right...
                _CONFIG_VARS['LDSHARED'] = "gcc -Wl,-x -dynamiclib -undefined dynamic_lookup"
                _CONFIG_VARS['CCSHARED'] = " -dynamiclib"
                _CONFIG_VARS['SO'] = ".dylib"
                customize_compiler(compiler)
            finally:
                _CONFIG_VARS.clear()
                _CONFIG_VARS.update(tmp)
        else:
            customize_compiler(compiler)

        if self.include_dirs is not None:
            compiler.set_include_dirs(self.include_dirs)
        if self.define is not None:
            # 'define' option is a list of (name,value) tuples
            for (name,value) in self.define:
                compiler.define_macro(name, value)
        if self.undef is not None:
            for macro in self.undef:
                compiler.undefine_macro(macro)
        if self.libraries is not None:
            compiler.set_libraries(self.libraries)
        if self.library_dirs is not None:
            compiler.set_library_dirs(self.library_dirs)
        if self.rpath is not None:
            compiler.set_runtime_library_dirs(self.rpath)
        if self.link_objects is not None:
            compiler.set_link_objects(self.link_objects)

        # hack so distutils' build_extension() builds a library instead
        compiler.link_shared_object = link_shared_object.__get__(compiler) 
開發者ID:MayOneUS,項目名稱:pledgeservice,代碼行數:40,代碼來源:build_ext.py


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