當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。