[Python-checkins] distutils2: merge with Andr?

tarek.ziade python-checkins at python.org
Sun Jan 30 14:49:25 CET 2011


tarek.ziade pushed e29ec36290b6 to distutils2:

http://hg.python.org/distutils2/rev/e29ec36290b6
changeset:   970:e29ec36290b6
parent:      965:fcd52b00517a
parent:      969:5d00f818f749
user:        Alexis Metaireau <alexis at notmyidea.org>
date:        Sun Jan 30 12:04:25 2011 +0100
summary:
  merge with Andr?

files:
  

diff --git a/distutils2/_backport/pkgutil.py b/distutils2/_backport/pkgutil.py
--- a/distutils2/_backport/pkgutil.py
+++ b/distutils2/_backport/pkgutil.py
@@ -922,10 +922,6 @@
                 for field in ('Obsoletes', 'Requires', 'Provides'):
                     del self.metadata[field]
 
-            provides = "%s (%s)" % (self.metadata['name'],
-                                    self.metadata['version'])
-            self.metadata['Provides-Dist'] += (provides,)
-
         reqs = []
 
         if requires is not None:
diff --git a/distutils2/_backport/tests/fake_dists/coconuts-aster-10.3.egg-info/PKG-INFO b/distutils2/_backport/tests/fake_dists/coconuts-aster-10.3.egg-info/PKG-INFO
new file mode 100644
--- /dev/null
+++ b/distutils2/_backport/tests/fake_dists/coconuts-aster-10.3.egg-info/PKG-INFO
@@ -0,0 +1,5 @@
+Metadata-Version: 1.2
+Name: coconuts-aster
+Version: 10.3
+Provides-Dist: strawberry (0.6)
+Provides-Dist: banana (0.4)
diff --git a/distutils2/_backport/tests/test_pkgutil.py b/distutils2/_backport/tests/test_pkgutil.py
--- a/distutils2/_backport/tests/test_pkgutil.py
+++ b/distutils2/_backport/tests/test_pkgutil.py
@@ -389,6 +389,7 @@
 
         # Now, test if the egg-info distributions are found correctly as well
         fake_dists += [('bacon', '0.1'), ('cheese', '2.0.2'),
+                       ('coconuts-aster', '10.3'),
                        ('banana', '0.4'), ('strawberry', '0.6'),
                        ('truffles', '5.0'), ('nut', 'funkyversion')]
         found_dists = []
@@ -494,18 +495,18 @@
 
         l = [dist.name for dist in provides_distribution('truffles', '>1.5',
                                                          use_egg_info=True)]
-        checkLists(l, ['bacon', 'truffles'])
+        checkLists(l, ['bacon'])
 
         l = [dist.name for dist in provides_distribution('truffles', '>=1.0')]
         checkLists(l, ['choxie', 'towel-stuff'])
 
         l = [dist.name for dist in provides_distribution('strawberry', '0.6',
                                                          use_egg_info=True)]
-        checkLists(l, ['strawberry'])
+        checkLists(l, ['coconuts-aster'])
 
         l = [dist.name for dist in provides_distribution('strawberry', '>=0.5',
                                                          use_egg_info=True)]
-        checkLists(l, ['strawberry'])
+        checkLists(l, ['coconuts-aster'])
 
         l = [dist.name for dist in provides_distribution('strawberry', '>0.6',
                                                          use_egg_info=True)]
@@ -513,11 +514,11 @@
 
         l = [dist.name for dist in provides_distribution('banana', '0.4',
                                                          use_egg_info=True)]
-        checkLists(l, ['banana'])
+        checkLists(l, ['coconuts-aster'])
 
         l = [dist.name for dist in provides_distribution('banana', '>=0.3',
                                                          use_egg_info=True)]
-        checkLists(l, ['banana'])
+        checkLists(l, ['coconuts-aster'])
 
         l = [dist.name for dist in provides_distribution('banana', '!=0.4',
                                                          use_egg_info=True)]
@@ -557,7 +558,7 @@
 
         eggs = [('bacon', '0.1'), ('banana', '0.4'), ('strawberry', '0.6'),
                 ('truffles', '5.0'), ('cheese', '2.0.2'),
-                ('nut', 'funkyversion')]
+                ('coconuts-aster', '10.3'), ('nut', 'funkyversion')]
         dists = [('choxie', '2.0.0.9'), ('grammar', '1.0a4'),
                  ('towel-stuff', '0.1')]
 
diff --git a/distutils2/config.py b/distutils2/config.py
--- a/distutils2/config.py
+++ b/distutils2/config.py
@@ -6,6 +6,7 @@
 import re
 import sys
 from ConfigParser import RawConfigParser
+from shlex import split
 
 from distutils2 import logger
 from distutils2.errors import DistutilsOptionError
@@ -17,15 +18,9 @@
 
 def _pop_values(values_dct, key):
     """Remove values from the dictionary and convert them as a list"""
-    vals_str = values_dct.pop(key, None)
-    if not vals_str:
-        return
+    vals_str = values_dct.pop(key, '')
     # Get bash options like `gcc -print-file-name=libgcc.a`
-    vals = re.search('(`.*?`)', vals_str) or []
-    if vals:
-        vals = list(vals.groups())
-        vals_str = re.sub('`.*?`', '', vals_str)
-    vals.extend(vals_str.split())
+    vals = split(vals_str)
     if vals:
         return vals
 
diff --git a/distutils2/tests/test_config.py b/distutils2/tests/test_config.py
--- a/distutils2/tests/test_config.py
+++ b/distutils2/tests/test_config.py
@@ -103,7 +103,7 @@
 [extension=speed_coconuts]
 name = one.speed_coconuts
 sources = c_src/speed_coconuts.c
-extra_link_args = `gcc -print-file-name=libgcc.a` -shared
+extra_link_args = "`gcc -print-file-name=libgcc.a`" -shared
 define_macros = HAVE_CAIRO HAVE_GTK2
 
 [extension=fast_taunt]

--
Repository URL: http://hg.python.org/distutils2


More information about the Python-checkins mailing list