本文整理汇总了Python中setuptools.Distribution.parse_command_line方法的典型用法代码示例。如果您正苦于以下问题:Python Distribution.parse_command_line方法的具体用法?Python Distribution.parse_command_line怎么用?Python Distribution.parse_command_line使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类setuptools.Distribution
的用法示例。
在下文中一共展示了Distribution.parse_command_line方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_install_lib
# 需要导入模块: from setuptools import Distribution [as 别名]
# 或者: from setuptools.Distribution import parse_command_line [as 别名]
def get_install_lib(args):
# This helper uses the distutils/setuptools machinery to determine
# where a command will install files based on the arguments passed
# to setup.py
dist = Distribution({'script_args': args})
dist.parse_command_line()
install_cmd = dist.get_command_obj('install')
install_cmd.ensure_finalized()
return install_cmd.install_lib
示例2: getprefix
# 需要导入模块: from setuptools import Distribution [as 别名]
# 或者: from setuptools.Distribution import parse_command_line [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