本文整理汇总了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]
示例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
示例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