[Python-checkins] python/dist/src/Lib/distutils core.py, 1.61, 1.62 dist.py, 1.69, 1.70

anthonybaxter at users.sourceforge.net anthonybaxter at users.sourceforge.net
Wed Oct 13 14:35:30 CEST 2004


Update of /cvsroot/python/python/dist/src/Lib/distutils
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29037

Modified Files:
	core.py dist.py 
Log Message:
Backing out the basic dependency checking (from pycon sprint).
This support was only a first cut, and doesn't deserve to be in
a released version (where we have to support it in an ongoing
manner)


Index: core.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/distutils/core.py,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -d -r1.61 -r1.62
--- core.py	18 Jul 2004 06:14:42 -0000	1.61
+++ core.py	13 Oct 2004 12:35:27 -0000	1.62
@@ -47,8 +47,7 @@
                   'name', 'version', 'author', 'author_email',
                   'maintainer', 'maintainer_email', 'url', 'license',
                   'description', 'long_description', 'keywords',
-                  'platforms', 'classifiers', 'download_url',
-                  'provides', 'requires', )
+                  'platforms', 'classifiers', 'download_url',)
 
 # Legal keyword arguments for the Extension constructor
 extension_keywords = ('name', 'sources', 'include_dirs',

Index: dist.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/distutils/dist.py,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -d -r1.69 -r1.70
--- dist.py	3 Aug 2004 16:37:39 -0000	1.69
+++ dist.py	13 Oct 2004 12:35:27 -0000	1.70
@@ -223,51 +223,6 @@
                 else:
                     sys.stderr.write(msg + "\n")
 
-            # Build up the requires sequence
-            from distutils.version import LooseVersion
-            requires = attrs.get('requires')
-            if requires:
-                if isinstance(requires, type('')):
-                    raise DistutilsOptionError, 'requires should be a sequence'
-                newreq = []
-                for req in requires:
-                    if '-' not in req:
-                        # We have a plain package name - any version will do
-                        newreq.append((req,None))
-                    else:
-                        pkg, ver = string.split(req, '-', 1)
-                        newreq.append((pkg, LooseVersion(ver)))
-                attrs['requires'] = newreq
-
-            # Build up the provides object. If the setup() has no
-            # provides line, we use packages or modules and the version
-            # to synthesise the provides. If no version is provided (no
-            # pun intended) we don't have a provides entry at all.
-            provides = attrs.get('provides')
-            if provides:
-                if isinstance(provides, type('')):
-                    raise DistutilsOptionError, 'provides should be a sequence'
-                newprov = []
-                for prov in provides:
-                    if '-' not in prov:
-                        # We have a plain package name - any version will do
-                        newprov.append((prov,None))
-                    else:
-                        pkg, ver = string.split(prov, '-', 1)
-                        newprov.append((pkg, LooseVersion(ver)))
-                attrs['provides'] = newprov
-            elif attrs.get('version'):
-                # Build a provides line
-                prov = []
-                if attrs.get('packages'):
-                    for pkg in attrs['packages']:
-                        pkg = string.replace(pkg, '/', '.')
-                        prov.append('%s-%s'%(pkg, attrs['version']))
-                elif attrs.get('modules'):
-                    for mod in attrs['modules']:
-                        prov.append('%s-%s'%(mod, attrs['version']))
-                attrs['provides'] = prov
-
             # Now work on the rest of the attributes.  Any attribute that's
             # not already defined is invalid!
             for (key,val) in attrs.items():
@@ -275,7 +230,6 @@
                     setattr(self.metadata, key, val)
                 elif hasattr(self, key):
                     setattr(self, key, val)
-                else:
                     msg = "Unknown distribution option: %s" % repr(key)
                     if warnings is not None:
                         warnings.warn(msg)
@@ -1060,7 +1014,7 @@
                          "license", "description", "long_description",
                          "keywords", "platforms", "fullname", "contact",
                          "contact_email", "license", "classifiers",
-                         "download_url", "provides", "requires",)
+                         "download_url")
 
     def __init__ (self):
         self.name = None
@@ -1077,8 +1031,6 @@
         self.platforms = None
         self.classifiers = None
         self.download_url = None
-        self.requires = []
-        self.provides = []
 
     def write_pkg_info (self, base_dir):
         """Write the PKG-INFO file into the release tree.
@@ -1094,10 +1046,6 @@
         pkg_info.write('Author: %s\n' % self.get_contact() )
         pkg_info.write('Author-email: %s\n' % self.get_contact_email() )
         pkg_info.write('License: %s\n' % self.get_license() )
-        for req in self.get_requires():
-            pkg_info.write('Requires: %s\n' % req )
-        for prov in self.get_provides():
-            pkg_info.write('Provides: %s\n' % prov )
         if self.download_url:
             pkg_info.write('Download-URL: %s\n' % self.download_url)
 
@@ -1176,13 +1124,6 @@
     def get_download_url(self):
         return self.download_url or "UNKNOWN"
 
-    def get_requires(self):
-        return [ '%s%s%s'%(x, (y and '-') or '', y or '')
-                                                for x,y in self.requires ]
-
-    def get_provides(self):
-        return self.provides
-
 # class DistributionMetadata
 
 



More information about the Python-checkins mailing list