[Python-Dev] [Python-checkins] r83992 - in python/branches/release26-maint: Lib/distutils/command/sdist.py Lib/distutils/tests/test_sdist.py Misc/NEWS (original) (raw)

Barry Warsaw barry at python.org
Sat Aug 14 04:43:38 CEST 2010


On Aug 14, 2010, at 04:07 AM, eric.araujo wrote:

Author: eric.araujo Date: Sat Aug 14 04:07:26 2010 New Revision: 83992

Log: Revert regression from r81256 (with release manager approval, see #8688)

This was a regression in 2.6.6rc1 and I'm grateful to Eric for reverting it. While I trust he did the merge faithfully, it's still a big enough change between rc1 and final that I encourage folks who are affected by this to test current svn head for release26-maint and make sure it's working the way you expect it to. This means "the same as Python 2.6.5". We've decided not to apply any behavior changing patches to Python 2.6 so you'll just have to live with the devil you know here, or upgrade to Python 2.7.

Please let me know before Monday if you notice any problems.

Again, thanks Eric! -Barry

Modified: python/branches/release26-maint/Lib/distutils/command/sdist.py python/branches/release26-maint/Lib/distutils/tests/testsdist.py python/branches/release26-maint/Misc/NEWS Modified: python/branches/release26-maint/Lib/distutils/command/sdist.py ============================================================================== --- python/branches/release26-maint/Lib/distutils/command/sdist.py (original) +++ python/branches/release26-maint/Lib/distutils/command/sdist.py Sat Aug 14 04:07:26 2010 @@ -57,8 +57,7 @@ "just regenerate the manifest and then stop " "(implies --force-manifest)"), ('force-manifest', 'f', - "forcibly regenerate the manifest and carry on as usual. " - "Deprecated: now the manifest is always regenerated."), + "forcibly regenerate the manifest and carry on as usual"), ('formats=', None, "formats for source distribution (comma-separated list)"), ('keep-temp', 'k', @@ -191,34 +190,67 @@ distribution, and put it in 'self.filelist'. This might involve reading the manifest template (and writing the manifest), or just reading the manifest, or just using the default file set -- it all - depends on the user's options. + depends on the user's options and the state of the filesystem. """ - # new behavior: - # the file list is recalculated everytime because - # even if MANIFEST.in or setup.py are not changed - # the user might have added some files in the tree that - # need to be included. - # - # This makes --force the default and only behavior. - templateexists = os.path.isfile(self.template) - if not templateexists: - self.warn(("manifest template '%s' does not exist " + - "(using default file list)") % - self.template) - self.filelist.findall() - - if self.usedefaults: - self.adddefaults() + # If we have a manifest template, see if it's newer than the + # manifest; if so, we'll regenerate the manifest. + templateexists = os.path.isfile(self.template) if templateexists: - self.readtemplate() + templatenewer = deputil.newer(self.template, self.manifest) - if self.prune: - self.prunefilelist() + # The contents of the manifest file almost certainly depend on the + # setup script as well as the manifest template -- so if the setup + # script is newer than the manifest, we'll regenerate the manifest + # from the template. (Well, not quite: if we already have a + # manifest, but there's no template -- which will happen if the + # developer elects to generate a manifest some other way -- then we + # can't regenerate the manifest, so we don't.) + self.debugprint("checking if %s newer than %s" % + (self.distribution.scriptname, self.manifest)) + setupnewer = deputil.newer(self.distribution.scriptname, + self.manifest) + + # cases: + # 1) no manifest, template exists: generate manifest + # (covered by 2a: no manifest == template newer) + # 2) manifest & template exist: + # 2a) template or setup script newer than manifest: + # regenerate manifest + # 2b) manifest newer than both: + # do nothing (unless --force or --manifest-only) + # 3) manifest exists, no template: + # do nothing (unless --force or --manifest-only) + # 4) no manifest, no template: generate w/ warning ("defaults only") + + manifestoutofdate = (templateexists and + (templatenewer or setupnewer)) + forceregen = self.forcemanifest or self.manifestonly + manifestexists = os.path.isfile(self.manifest) + neitherexists = (not templateexists and not manifestexists) + + # Regenerate the manifest if necessary (or if explicitly told to) + if manifestoutofdate or neitherexists or forceregen: + if not templateexists: + self.warn(("manifest template '%s' does not exist " + + "(using default file list)") % + self.template) + self.filelist.findall() + + if self.usedefaults: + self.adddefaults() + if templateexists: + self.readtemplate() + if self.prune: + self.prunefilelist() + + self.filelist.sort() + self.filelist.removeduplicates() + self.writemanifest() - self.filelist.sort() - self.filelist.removeduplicates() - self.writemanifest() + # Don't regenerate the manifest, just read it in. + else: + self.readmanifest() # getfilelist () Modified: python/branches/release26-maint/Lib/distutils/tests/testsdist.py ============================================================================== --- python/branches/release26-maint/Lib/distutils/tests/testsdist.py (original) +++ python/branches/release26-maint/Lib/distutils/tests/testsdist.py Sat Aug 14 04:07:26 2010 @@ -29,7 +29,6 @@ super(sdistTestCase, self).setUp() self.oldpath = os.getcwd() self.temppkg = os.path.join(self.mkdtemp(), 'temppkg') - self.tmpdir = self.mkdtemp() def tearDown(self): os.chdir(self.oldpath) @@ -152,67 +151,6 @@ self.assertEquals(result, ['fake-1.0.tar', 'fake-1.0.tar.gz']) - def getcmd(self, metadata=None): - """Returns a cmd""" - if metadata is None: - metadata = {'name': 'fake', 'version': '1.0', - 'url': 'xxx', 'author': 'xxx', - 'authoremail': 'xxx'} - dist = Distribution(metadata) - dist.scriptname = 'setup.py' - dist.packages = ['somecode'] - dist.includepackagedata = True - cmd = sdist(dist) - cmd.distdir = 'dist' - def warn(*args): - pass - cmd.warn = warn - return dist, cmd - - def testgetfilelist(self): - # make sure MANIFEST is recalculated - dist, cmd = self.getcmd() - - os.chdir(self.tmpdir) - - # filling datafiles by pointing files in packagedata - os.mkdir(os.path.join(self.tmpdir, 'somecode')) - self.writefile((self.tmpdir, 'somecode', 'init.py'), '#') - self.writefile((self.tmpdir, 'somecode', 'one.py'), '#') - cmd.ensurefinalized() - cmd.run() - - f = open(cmd.manifest) - try: - manifest = [line.strip() for line in f.read().split('\n') - if line.strip() != ''] - finally: - f.close() - - self.assertEquals(len(manifest), 2) - - # adding a file - self.writefile((self.tmpdir, 'somecode', 'two.py'), '#') - - # make sure buildpy is reinitinialized, like a fresh run - buildpy = dist.getcommandobj('buildpy') - buildpy.finalized = False - buildpy.ensurefinalized() - - cmd.run() - - f = open(cmd.manifest) - try: - manifest2 = [line.strip() for line in f.read().split('\n') - if line.strip() != ''] - finally: - f.close() - - # do we have the new file in MANIFEST ? - self.assertEquals(len(manifest2), 3) - self.assert('two.py' in manifest2[-1]) - - def testsuite(): return unittest.makeSuite(sdistTestCase) Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Sat Aug 14 04:07:26 2010 @@ -12,6 +12,9 @@ Library ------- +- Issue #8688: Revert regression introduced in 2.6.6rc1 (making Distutils + recalculate MANIFEST every time). + - Issue #5798: Handle select.poll flag oddities properly on OS X. This fixes testasynchat and testsmtplib failures on OS X.


Python-checkins mailing list Python-checkins at python.org http://mail.python.org/mailman/listinfo/python-checkins -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: not available URL: <http://mail.python.org/pipermail/python-dev/attachments/20100813/53d42647/attachment-0001.pgp>



More information about the Python-Dev mailing list