本文整理汇总了Python中setuptools.Distribution.dry_run方法的典型用法代码示例。如果您正苦于以下问题:Python Distribution.dry_run方法的具体用法?Python Distribution.dry_run怎么用?Python Distribution.dry_run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类setuptools.Distribution
的用法示例。
在下文中一共展示了Distribution.dry_run方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_setuptools_script_dir
# 需要导入模块: from setuptools import Distribution [as 别名]
# 或者: from setuptools.Distribution import dry_run [as 别名]
def get_setuptools_script_dir():
" Get the directory setuptools installs scripts to for current python "
dist = Distribution({'cmdclass': {'install': OnlyGetScriptPath}})
dist.dry_run = True # not sure if necessary
dist.parse_config_files()
command = dist.get_command_obj('install')
command.ensure_finalized()
command.run()
return dist.install_scripts
示例2: get_setuptools_script_dir
# 需要导入模块: from setuptools import Distribution [as 别名]
# 或者: from setuptools.Distribution import dry_run [as 别名]
def get_setuptools_script_dir():
# Run the above class just to get paths
dist = Distribution({'cmdclass': {'install': GetPaths}})
dist.dry_run = True
dist.parse_config_files()
command = dist.get_command_obj('install')
command.ensure_finalized()
command.run()
src_dir = glob(os.path.join(dist.install_libbase, 'pomoxis-*', 'exes'))[0]
for exe in (os.path.join(src_dir, x) for x in os.listdir(src_dir)):
print("Copying", os.path.basename(exe), '->', dist.install_scripts)
shutil.copy(exe, dist.install_scripts)
return dist.install_libbase, dist.install_scripts
示例3: getprefix
# 需要导入模块: from setuptools import Distribution [as 别名]
# 或者: from setuptools.Distribution import dry_run [as 别名]
def getprefix(self):
'''Retrieve setup tool calculated prefix
:returns: prefix
:rtype: string
'''
dist = Distribution({'cmdclass': {'install': OnlyGetScriptPath}})
dist.dry_run = True # not sure if necessary, but to be safe
dist.parse_config_files()
try:
dist.parse_command_line()
except (distutils.errors.DistutilsArgError, AttributeError):
pass
command = dist.get_command_obj('install')
command.ensure_finalized()
command.run()
prefix = dist.install_scripts.replace('/bin', '')
return prefix