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


Python setup.cfg方法代码示例

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


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

示例1: finalize_options

# 需要导入模块: from distutils.core import setup [as 别名]
# 或者: from distutils.core.setup import cfg [as 别名]
def finalize_options(self):
        if self.q_home is None:
            self.q_home = get_q_home(os.environ)
        if self.q_arch is None:
            self.q_arch = get_q_arch(self.q_home)
        if self.q_version is None:
            self.q_version = get_q_version(self.q_home)
        if self.python_dll is None:
            self.python_dll = get_python_dll(sys.executable)
        if self.dest is None:
            self.dest = 'setup.cfg'
        if WINDOWS:
            self.extra_link_args = [r'src\pyq\kx\%s\q.lib' % self.q_arch] 
开发者ID:KxSystems,项目名称:pyq,代码行数:15,代码来源:setup.py

示例2: __setattr__

# 需要导入模块: from distutils.core import setup [as 别名]
# 或者: from distutils.core.setup import cfg [as 别名]
def __setattr__(self, k, v):
        # Make sure we don't link against the SQLite library, no matter what setup.cfg says
        if self.amalgamation and k == "libraries":
            v = None
        self.__dict__[k] = v 
开发者ID:plasticityai,项目名称:magnitude,代码行数:7,代码来源:setup.py

示例3: check_extension_availability

# 需要导入模块: from distutils.core import setup [as 别名]
# 或者: from distutils.core.setup import cfg [as 别名]
def check_extension_availability(self, ext):
        cache = os.path.join(self.build_temp, "check_%s.out" % ext.feature_name)
        if not self.force and os.path.isfile(cache):
            data = open(cache).read().strip()
            if data == "1":
                return True
            elif data == "0":
                return False
        mkpath(self.build_temp)
        src = os.path.join(self.build_temp, "check_%s.c" % ext.feature_name)
        open(src, "w").write(ext.feature_check)
        log.info("checking if %s is compilable" % ext.feature_name)
        try:
            [obj] = self.compiler.compile(
                [src],
                macros=ext.define_macros + [(undef,) for undef in ext.undef_macros],
                include_dirs=ext.include_dirs,
                extra_postargs=(ext.extra_compile_args or []),
                depends=ext.depends,
            )
        except CompileError:
            log.warn("")
            log.warn(
                "%s is not found or a compiler error: forcing --%s"
                % (ext.feature_name, ext.neg_option_name)
            )
            log.warn(
                "(if %s is installed correctly, you may need to" % ext.feature_name
            )
            log.warn(" specify the option --include-dirs or uncomment and")
            log.warn(" modify the parameter include_dirs in setup.cfg)")
            open(cache, "w").write("0\n")
            return False
        prog = "check_%s" % ext.feature_name
        log.info("checking if %s is linkable" % ext.feature_name)
        try:
            self.compiler.link_executable(
                [obj],
                prog,
                output_dir=self.build_temp,
                libraries=ext.libraries,
                library_dirs=ext.library_dirs,
                runtime_library_dirs=ext.runtime_library_dirs,
                extra_postargs=(ext.extra_link_args or []),
            )
        except LinkError:
            log.warn("")
            log.warn(
                "%s is not found or a linker error: forcing --%s"
                % (ext.feature_name, ext.neg_option_name)
            )
            log.warn(
                "(if %s is installed correctly, you may need to" % ext.feature_name
            )
            log.warn(" specify the option --library-dirs or uncomment and")
            log.warn(" modify the parameter library_dirs in setup.cfg)")
            open(cache, "w").write("0\n")
            return False
        open(cache, "w").write("1\n")
        return True 
开发者ID:python-poetry,项目名称:poetry,代码行数:62,代码来源:setup.py


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