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


Python _config_vars.copy方法代码示例

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


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

示例1: copy_extensions_to_source

# 需要导入模块: from distutils.sysconfig import _config_vars [as 别名]
# 或者: from distutils.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: _customize_compiler_for_shlib

# 需要导入模块: from distutils.sysconfig import _config_vars [as 别名]
# 或者: from distutils.sysconfig._config_vars import copy [as 别名]
def _customize_compiler_for_shlib(compiler):
    if sys.platform == "darwin":
        # building .dylib requires additional compiler flags on OSX; here we
        # temporarily substitute the pyconfig.h variables so that distutils'
        # 'customize_compiler' uses them before we build the shared libraries.
        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) 
开发者ID:sofia-netsurv,项目名称:python-netsurv,代码行数:20,代码来源:build_ext.py

示例3: copy_extensions_to_source

# 需要导入模块: from distutils.sysconfig import _config_vars [as 别名]
# 或者: from distutils.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


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