当前位置: 首页>>代码示例>>Python>>正文


Python Distribution.run_commands方法代码示例

本文整理汇总了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)
开发者ID:Postgre,项目名称:HackingTools,代码行数:17,代码来源:test_bdist_egg.py

示例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
开发者ID:benoit-pierre,项目名称:setuptools,代码行数:18,代码来源:test_bdist_egg.py

示例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()
开发者ID:Postgre,项目名称:HackingTools,代码行数:19,代码来源:test_build_py.py

示例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))
开发者ID:0x,项目名称:kivi-tests,代码行数:21,代码来源:test_bdist_egg.py

示例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)
开发者ID:bellenot,项目名称:root,代码行数:14,代码来源:setup.py

示例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)
开发者ID:agiledata,项目名称:pkglib,代码行数:7,代码来源:dist.py


注:本文中的setuptools.dist.Distribution.run_commands方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。