我们从Python开源项目中,提取了以下50个代码示例,用于说明如何使用setuptools.command.egg_info()。
def run_setup(self, setup_script, setup_base, args): sys.modules.setdefault('distutils.command.bdist_egg', bdist_egg) sys.modules.setdefault('distutils.command.egg_info', egg_info) args = list(args) if self.verbose > 2: v = 'v' * (self.verbose - 1) args.insert(0, '-' + v) elif self.verbose < 2: args.insert(0, '-q') if self.dry_run: args.insert(0, '-n') log.info( "Running %s %s", setup_script[len(setup_base) + 1:], ' '.join(args) ) try: run_setup(setup_script, args) except SystemExit as v: raise DistutilsError("Setup script exited with %s" % (v.args[0],))
def run_setup(self, setup_script, setup_base, args): sys.modules.setdefault('distutils.command.bdist_egg', bdist_egg) sys.modules.setdefault('distutils.command.egg_info', egg_info) args = list(args) if self.verbose>2: v = 'v' * (self.verbose - 1) args.insert(0,'-'+v) elif self.verbose<2: args.insert(0,'-q') if self.dry_run: args.insert(0,'-n') log.info( "Running %s %s", setup_script[len(setup_base)+1:], ' '.join(args) ) try: run_setup(setup_script, args) except SystemExit: v = sys.exc_info()[1] raise DistutilsError("Setup script exited with %s" % (v.args[0],))
def test_svn_tags(self): code, data = environment.run_setup_py(["egg_info", "--tag-svn-revision"], pypath=self.old_cwd, data_stream=1) if code: raise AssertionError(data) pkginfo = os.path.join('dummy.egg-info', 'PKG-INFO') infile = open(pkginfo, 'r') try: read_contents = infile.readlines() finally: infile.close() del infile self.assertTrue("Version: 0.1.1.post1\n" in read_contents)
def test_no_tags(self): code, data = environment.run_setup_py(["egg_info"], pypath=self.old_cwd, data_stream=1) if code: raise AssertionError(data) pkginfo = os.path.join('dummy.egg-info', 'PKG-INFO') infile = open(pkginfo, 'r') try: read_contents = infile.readlines() finally: infile.close() del infile self.assertTrue("Version: 0.1.1\n" in read_contents)