distutils2: 7d1a7251d771 (original) (raw)

--- a/CHANGES.txt +++ b/CHANGES.txt @@ -166,6 +166,9 @@ 1.0a4 - 2012-02-?? script with pysetup create [éric]

+- #6884: Fix MANIFEST.in parsing bugs on Windows [éric, nadeem] +- #11841: Fix comparison bug with 'rc' versions [filip] 1.0a3 - 2010-10-08

--- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -69,3 +69,4 @@ Thanks to:

--- a/distutils2/manifest.py +++ b/distutils2/manifest.py @@ -272,6 +272,7 @@ class Manifest: Return True if files are found. """

@@ -335,11 +336,14 @@ def _glob_to_re(pattern): # IMHO is wrong -- '?' and '*' aren't supposed to match slash in Unix, # and by extension they shouldn't match such "special characters" under # any OS. So change all non-escaped dots in the RE to match any

-

--- a/distutils2/tests/fixer/init.py +++ b/distutils2/tests/fixer/init.py @@ -0,0 +1,1 @@ +"""Example fixers used in tests."""

--- a/distutils2/tests/test_command_build_ext.py +++ b/distutils2/tests/test_command_build_ext.py @@ -150,7 +150,8 @@ class BuildExtTestCase(support.TempdirMa cmd = build_ext(dist) cmd.library_dirs = 'my_lib_dir%sother_lib_dir' % os.pathsep cmd.finalize_options()

# make sure rpath is turned into a list # if it's a string

--- a/distutils2/tests/test_manifest.py +++ b/distutils2/tests/test_manifest.py @@ -7,7 +7,22 @@ from distutils2.manifest import Manifest from distutils2.tests import unittest, support -_MANIFEST = """[](#l6.7) +MANIFEST_IN = """[](#l6.8) +include ok +include xo +exclude xo +include foo.tmp +include buildout.cfg +global-include *.x +global-include *.txt +global-exclude *.tmp +recursive-include f *.oo +recursive-exclude global *.x +graft dir +prune dir3 +""" + +MANIFEST_IN_2 = """[](#l6.23) recursive-include foo *.py # ok

nothing here

@@ -17,12 +32,17 @@ recursive-include bar \ *.dat *.txt """ -_MANIFEST2 = """[](#l6.31) +MANIFEST_IN_3 = """[](#l6.32) README file1 """ +def make_local_path(s):

+ + class ManifestTestCase(support.TempdirManager, support.LoggingCatcher, unittest.TestCase): @@ -37,7 +57,7 @@ class ManifestTestCase(support.TempdirMa tmpdir = self.mkdtemp() MANIFEST = os.path.join(tmpdir, 'MANIFEST.in') with open(MANIFEST, 'w') as f:

manifest = Manifest() manifest.read_template(MANIFEST) @@ -63,27 +83,74 @@ class ManifestTestCase(support.TempdirMa os.chdir(tmpdir) self.write_file('README', 'xxx') self.write_file('file1', 'xxx')

def test_glob_to_re(self):

+

+

+

+

+

def test_remove_duplicates(self): manifest = Manifest() manifest.files = ['a', 'b', 'a', 'g', 'c', 'g']

@@ -143,6 +210,7 @@ class ManifestTestCase(support.TempdirMa self.assertEqual(manifest.allfiles, ['a.py', 'b.txt']) def test_process_template(self):

@@ -153,7 +221,7 @@ class ManifestTestCase(support.TempdirMa # implicit include manifest = Manifest()

manifest._process_template_line('*.py') self.assertEqual(manifest.files, ['a.py']) @@ -161,7 +229,7 @@ class ManifestTestCase(support.TempdirMa # include manifest = Manifest()

manifest._process_template_line('include *.py') self.assertEqual(manifest.files, ['a.py']) @@ -173,31 +241,31 @@ class ManifestTestCase(support.TempdirMa # exclude manifest = Manifest()

manifest._process_template_line('exclude *.py')

manifest._process_template_line('exclude *.rb')

# global-include manifest = Manifest()

manifest._process_template_line('global-include *.py')

manifest._process_template_line('global-include *.rb')

# global-exclude manifest = Manifest()

manifest._process_template_line('global-exclude *.py') self.assertEqual(manifest.files, ['b.txt']) @@ -209,50 +277,50 @@ class ManifestTestCase(support.TempdirMa # recursive-include manifest = Manifest()

manifest._process_template_line('recursive-include d *.py')

manifest._process_template_line('recursive-include e *.py')

# recursive-exclude manifest = Manifest()

manifest._process_template_line('recursive-exclude d *.py')

manifest._process_template_line('recursive-exclude e *.py')

# graft manifest = Manifest()

manifest._process_template_line('graft d')

manifest._process_template_line('graft e')

# prune manifest = Manifest()

manifest._process_template_line('prune d')

manifest._process_template_line('prune e')

--- a/distutils2/tests/test_util.py +++ b/distutils2/tests/test_util.py @@ -173,6 +173,11 @@ class UtilTestCase(support.EnvironRestor sys.stdout = self.old_stdout sys.stderr = self.old_stderr

+ def test_convert_path(self): # linux/mac os.sep = '/'

--- a/distutils2/tests/test_version.py +++ b/distutils2/tests/test_version.py @@ -16,6 +16,7 @@ class VersionTestCase(unittest.TestCase) (V('1.2'), '1.2'), (V('1.2.3a4'), '1.2.3a4'), (V('1.2c4'), '1.2c4'),

@@ -146,6 +147,14 @@ class VersionTestCase(unittest.TestCase) """ doctest.script_from_examples(comparison_doctest_string)

+ def test_suggest_normalized_version(self): self.assertEqual(suggest('1.0'), '1.0')

--- a/distutils2/version.py +++ b/distutils2/version.py @@ -11,19 +11,20 @@ from distutils2.errors import Irrational

A marker used in the second and third parts of the parts tuple, for

versions that don't have those segments, to sort properly. An example

of versions in sort order ('highest' last):

-# 1.0b1 ((1,0), ('b',1), ('f',)) -# 1.0.dev345 ((1,0), ('f',), ('dev', 345)) -# 1.0 ((1,0), ('f',), ('f',)) -# 1.0.post256.dev345 ((1,0), ('f',), ('f', 'post', 256, 'dev', 345)) -# 1.0.post345 ((1,0), ('f',), ('f', 'post', 345, 'f')) +# 1.0b1 ((1,0), ('b',1), ('z',)) +# 1.0.dev345 ((1,0), ('z',), ('dev', 345)) +# 1.0 ((1,0), ('z',), ('z',)) +# 1.0.post256.dev345 ((1,0), ('z',), ('z', 'post', 256, 'dev', 345)) +# 1.0.post345 ((1,0), ('z',), ('z', 'post', 345, 'z'))

^ ^ ^

-# 'b' < 'f' ---------------------/ | | +# 'b' < 'z' ---------------------/ | |

| |

-# 'dev' < 'f' < 'post' -------------------/ | +# 'dev' < 'z' ----------------------------/ |

|

-# 'dev' < 'f' ----------------------------------------------/ -# Other letters would do, but 'f' for 'final' is kind of nice. -_FINAL_MARKER = ('f',) +# 'dev' < 'z' ----------------------------------------------/ +# 'f' for 'final' would be kind of nice, but due to bugs in the support of +# 'rc' we must use 'z' +_FINAL_MARKER = ('z',) _VERSION_RE = re.compile(r''' ^ @@ -167,8 +168,9 @@ class NormalizedVersion: if prerel is not _FINAL_MARKER: s += prerel[0] s += '.'.join(str(v) for v in prerel[1:])