本文整理汇总了Python中setuptools.dist.Distribution.run_commands方法的典型用法代码示例。如果您正苦于以下问题:Python Distribution.run_commands方法的具体用法?Python Distribution.run_commands怎么用?Python Distribution.run_commands使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类setuptools.dist.Distribution
的用法示例。
在下文中一共展示了Distribution.run_commands方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_bdist_egg
# 需要导入模块: from setuptools.dist import Distribution [as 别名]
# 或者: from setuptools.dist.Distribution import run_commands [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 run_commands [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 run_commands [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 run_commands [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: run_commands
# 需要导入模块: from setuptools.dist import Distribution [as 别名]
# 或者: from setuptools.dist.Distribution import run_commands [as 别名]
def run_commands(self):
# disable bdist_egg as it only packages the python code, skipping the build
if not is_manylinux():
for cmd in self.commands:
if cmd != 'bdist_egg':
self.run_command(cmd)
else:
log.info('Command "%s" is disabled', cmd)
cmd_obj = self.get_command_obj(cmd)
cmd_obj.get_outputs = lambda: None
else:
return Distribution.run_commands(self)
示例6: run_commands
# 需要导入模块: from setuptools.dist import Distribution [as 别名]
# 或者: from setuptools.dist.Distribution import run_commands [as 别名]
def run_commands(self):
logging.basicConfig()
level = ['WARN', 'INFO', 'DEBUG'][max(0, min(self.verbose, 2))]
logging.root.setLevel(level)
_Distribution.run_commands(self)