本文整理匯總了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