[Python-checkins] python/nondist/sandbox/setuptools/setuptools/command egg_info.py, 1.9, 1.10

pje@users.sourceforge.net pje at users.sourceforge.net
Sat Aug 6 20:46:30 CEST 2005


Update of /cvsroot/python/python/nondist/sandbox/setuptools/setuptools/command
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8052/setuptools/command

Modified Files:
	egg_info.py 
Log Message:
Enhanced setuptools infrastructure to support distutils extensions that
can be plugged in at setup() time to define new setup() arguments or
distutils commands.  This allows modularization and reuse of distutils
extensions in a way that was previously not possible.


Index: egg_info.py
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/setuptools/setuptools/command/egg_info.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- egg_info.py	24 Jul 2005 22:47:06 -0000	1.9
+++ egg_info.py	6 Aug 2005 18:46:28 -0000	1.10
@@ -9,7 +9,6 @@
 from distutils import log
 from pkg_resources import parse_requirements, safe_name, \
     safe_version, yield_lines, EntryPoint
-from setuptools.dist import iter_distribution_names
 
 class egg_info(Command):
 
@@ -39,6 +38,7 @@
 
 
 
+
     def finalize_options (self):
         self.egg_name = safe_name(self.distribution.get_name())
         self.egg_version = self.tagged_version()
@@ -149,7 +149,7 @@
     def write_toplevel_names(self):
         pkgs = dict.fromkeys(
             [k.split('.',1)[0]
-                for k in iter_distribution_names(self.distribution)
+                for k in self.distribution.iter_distribution_names()
             ]
         )
         toplevel = os.path.join(self.egg_info, "top_level.txt")
@@ -164,12 +164,8 @@
 
     def write_or_delete_dist_arg(self, argname, filename=None):
         value = getattr(self.distribution, argname, None)
-        if value is None:
-            return
-
         filename = filename or argname+'.txt'
         filename = os.path.join(self.egg_info,filename)
-
         if value:
             log.info("writing %s", filename)
             if not self.dry_run:
@@ -177,8 +173,12 @@
                 f.write('\n'.join(value))
                 f.write('\n')
                 f.close()
-
         elif os.path.exists(filename):
+            if value is None:
+                log.warn(
+                    "%s not set in setup(), but %s exists", argname, filename
+                )
+            return
             log.info("deleting %s", filename)
             if not self.dry_run:
                 os.unlink(filename)



More information about the Python-checkins mailing list