本文整理汇总了Python中setuptools.dist.Distribution.parse_command_line方法的典型用法代码示例。如果您正苦于以下问题:Python Distribution.parse_command_line方法的具体用法?Python Distribution.parse_command_line怎么用?Python Distribution.parse_command_line使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类setuptools.dist.Distribution
的用法示例。
在下文中一共展示了Distribution.parse_command_line方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_bdist_egg
# 需要导入模块: from setuptools.dist import Distribution [as 别名]
# 或者: from setuptools.dist.Distribution import parse_command_line [as 别名]
def test_bdist_egg(self, setup_context, user_override):
dist = Distribution(dict(
script_name='setup.py',
script_args=['bdist_egg'],
name='foo',
py_modules=['hi']
))
os.makedirs(os.path.join('build', 'src'))
with contexts.quiet():
dist.parse_command_line()
dist.run_commands()
# let's see if we got our egg link at the right place
[content] = os.listdir('dist')
assert re.match('foo-0.0.0-py[23].\d.egg$', content)
示例2: test_exclude_source_files
# 需要导入模块: from setuptools.dist import Distribution [as 别名]
# 或者: from setuptools.dist.Distribution import parse_command_line [as 别名]
def test_exclude_source_files(self, setup_context, user_override):
dist = Distribution(dict(
script_name='setup.py',
script_args=['bdist_egg', '--exclude-source-files'],
name='foo',
py_modules=['hi'],
))
with contexts.quiet():
dist.parse_command_line()
dist.run_commands()
[dist_name] = os.listdir('dist')
dist_filename = os.path.join('dist', dist_name)
zip = zipfile.ZipFile(dist_filename)
names = list(zi.filename for zi in zip.filelist)
assert 'hi.pyc' in names
assert 'hi.py' not in names
示例3: test_directories_in_package_data_glob
# 需要导入模块: from setuptools.dist import Distribution [as 别名]
# 或者: from setuptools.dist.Distribution import parse_command_line [as 别名]
def test_directories_in_package_data_glob(tmpdir_as_cwd):
"""
Directories matching the glob in package_data should
not be included in the package data.
Regression test for #261.
"""
dist = Distribution(dict(
script_name='setup.py',
script_args=['build_py'],
packages=[''],
name='foo',
package_data={'': ['path/*']},
))
os.makedirs('path/subpath')
dist.parse_command_line()
dist.run_commands()
示例4: test_bdist_egg
# 需要导入模块: from setuptools.dist import Distribution [as 别名]
# 或者: from setuptools.dist.Distribution import parse_command_line [as 别名]
def test_bdist_egg(self):
dist = Distribution(dict(
script_name='setup.py',
script_args=['bdist_egg'],
name='foo',
py_modules=['hi']
))
os.makedirs(os.path.join('build', 'src'))
old_stdout = sys.stdout
sys.stdout = o = StringIO()
try:
dist.parse_command_line()
dist.run_commands()
finally:
sys.stdout = old_stdout
# let's see if we got our egg link at the right place
[content] = os.listdir('dist')
self.assertTrue(re.match('foo-0.0.0-py[23].\d.egg$', content))
示例5: parse_command_line
# 需要导入模块: from setuptools.dist import Distribution [as 别名]
# 或者: from setuptools.dist.Distribution import parse_command_line [as 别名]
def parse_command_line(self):
self.disable_numpy=False
self.ant="ant"
return _Distribution.parse_command_line(self)