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


Python distutils.command方法代码示例

本文整理汇总了Python中distutils.command方法的典型用法代码示例。如果您正苦于以下问题:Python distutils.command方法的具体用法?Python distutils.command怎么用?Python distutils.command使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在distutils的用法示例。


在下文中一共展示了distutils.command方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: run

# 需要导入模块: import distutils [as 别名]
# 或者: from distutils import command [as 别名]
def run(self):
        self.run_command('egg_info')
        ei_cmd = self.get_finalized_command('egg_info')
        self.filelist = ei_cmd.filelist
        self.filelist.append(os.path.join(ei_cmd.egg_info, 'SOURCES.txt'))
        self.check_readme()

        # Run sub commands
        for cmd_name in self.get_sub_commands():
            self.run_command(cmd_name)

        # Call check_metadata only if no 'check' command
        # (distutils <= 2.6)
        import distutils.command

        if 'check' not in distutils.command.__all__:
            self.check_metadata()

        self.make_distribution()

        dist_files = getattr(self.distribution, 'dist_files', [])
        for file in self.archive_files:
            data = ('sdist', '', file)
            if data not in dist_files:
                dist_files.append(data) 
开发者ID:jpush,项目名称:jbox,代码行数:27,代码来源:sdist.py

示例2: run

# 需要导入模块: import distutils [as 别名]
# 或者: from distutils import command [as 别名]
def run(self):
        self.run_command('egg_info')
        ei_cmd = self.get_finalized_command('egg_info')
        self.filelist = ei_cmd.filelist
        self.filelist.append(os.path.join(ei_cmd.egg_info,'SOURCES.txt'))
        self.check_readme()

        # Run sub commands
        for cmd_name in self.get_sub_commands():
            self.run_command(cmd_name)

        # Call check_metadata only if no 'check' command
        # (distutils <= 2.6)
        import distutils.command
        if 'check' not in distutils.command.__all__:
            self.check_metadata()

        self.make_distribution()

        dist_files = getattr(self.distribution,'dist_files',[])
        for file in self.archive_files:
            data = ('sdist', '', file)
            if data not in dist_files:
                dist_files.append(data) 
开发者ID:MayOneUS,项目名称:pledgeservice,代码行数:26,代码来源:sdist.py

示例3: initialize_options

# 需要导入模块: import distutils [as 别名]
# 或者: from distutils import command [as 别名]
def initialize_options(self):
        # initialize_options() may be called multiple times on the
        # same command object, so make sure not to override previously
        # set options.
        if getattr(self, '_initialized', False):
            return

        super(build_ext, self).initialize_options()

        if os.environ.get('EDGEDB_DEBUG'):
            self.cython_always = True
            self.cython_annotate = True
            self.cython_directives = "linetrace=True"
            self.define = 'PG_DEBUG,CYTHON_TRACE,CYTHON_TRACE_NOGIL'
            self.debug = True
        else:
            self.cython_always = False
            self.cython_annotate = None
            self.cython_directives = None
            self.debug = False 
开发者ID:edgedb,项目名称:edgedb,代码行数:22,代码来源:setup.py

示例4: run

# 需要导入模块: import distutils [as 别名]
# 或者: from distutils import command [as 别名]
def run(self):
        """
        Run first the git commit format update $Format:%H$
        and after that the usual Python sdist
        """
        # git attributes
        command = ['make', 'git_attributes']
        self.announce(
            'Running make git_attributes target: %s' % str(command),
            level=distutils.log.INFO
        )
        self.announce(
            subprocess.check_output(command).decode(),
            level=distutils.log.INFO
        )

        # standard sdist process
        setuptools_sdist.sdist.run(self)

        # cleanup attributes
        command = ['make', 'clean_git_attributes']
        self.announce(
            subprocess.check_output(command).decode(),
            level=distutils.log.INFO
        ) 
开发者ID:OSInside,项目名称:kiwi,代码行数:27,代码来源:setup.py

示例5: make_release_tree

# 需要导入模块: import distutils [as 别名]
# 或者: from distutils import command [as 别名]
def make_release_tree(self, base_dir, files):
        orig.sdist.make_release_tree(self, base_dir, files)

        # Save any egg_info command line options used to create this sdist
        dest = os.path.join(base_dir, 'setup.cfg')
        if hasattr(os, 'link') and os.path.exists(dest):
            # unlink and re-copy, since it might be hard-linked, and
            # we don't want to change the source version
            os.unlink(dest)
            self.copy_file('setup.cfg', dest)

        self.get_finalized_command('egg_info').save_version_info(dest) 
开发者ID:jpush,项目名称:jbox,代码行数:14,代码来源:sdist.py

示例6: make_release_tree

# 需要导入模块: import distutils [as 别名]
# 或者: from distutils import command [as 别名]
def make_release_tree(self, base_dir, files):
        orig.sdist.make_release_tree(self, base_dir, files)

        # Save any egg_info command line options used to create this sdist
        dest = os.path.join(base_dir, 'setup.cfg')
        if hasattr(os,'link') and os.path.exists(dest):
            # unlink and re-copy, since it might be hard-linked, and
            # we don't want to change the source version
            os.unlink(dest)
            self.copy_file('setup.cfg', dest)

        self.get_finalized_command('egg_info').save_version_info(dest) 
开发者ID:MayOneUS,项目名称:pledgeservice,代码行数:14,代码来源:sdist.py

示例7: test_import_hooks_import_precence

# 需要导入模块: import distutils [as 别名]
# 或者: from distutils import command [as 别名]
def test_import_hooks_import_precence(self):
        """__import__ takes precedence over import hooks"""
        global myimpCalled
        myimpCalled = None
        class myimp(object):
            def find_module(self, fullname, path=None):
                global myimpCalled
                myimpCalled = fullname, path

        def myimport(*args):
            return 'myimport'

        import distutils
        import distutils.command
        mi = myimp()
        sys.meta_path.append(mi)
        builtinimp = get_builtins_dict()['__import__']
        try:
            get_builtins_dict()['__import__'] = myimport
        
            import abc
            self.assertEqual(abc, 'myimport')
            self.assertEqual(myimpCalled, None)
                    
            # reload on a built-in hits the loader protocol
            reload(distutils)
            self.assertEqual(myimpCalled, ('distutils', None))
            
            reload(distutils.command)
            self.assertEqual(myimpCalled[0], 'distutils.command')
            self.assertEqual(myimpCalled[1][0][-7:], 'distutils')
        finally:
            get_builtins_dict()['__import__'] = builtinimp
            sys.meta_path.remove(mi) 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:36,代码来源:test_imp.py


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