aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/command/egg_info.py
diff options
context:
space:
mode:
authorPJ Eby <distutils-sig@python.org>2005-08-06 18:46:28 +0000
committerPJ Eby <distutils-sig@python.org>2005-08-06 18:46:28 +0000
commit8a29467d941a7983d5f6eadc5c0e1624417944b6 (patch)
treeb270afe3a01c9bead94060de3c3adfa590bd933f /setuptools/command/egg_info.py
parenta762d97ea517f64a405d82ad7acaa85d3eb30c39 (diff)
downloadexternal_python_setuptools-8a29467d941a7983d5f6eadc5c0e1624417944b6.tar.gz
external_python_setuptools-8a29467d941a7983d5f6eadc5c0e1624417944b6.tar.bz2
external_python_setuptools-8a29467d941a7983d5f6eadc5c0e1624417944b6.zip
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. --HG-- branch : setuptools extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/trunk/setuptools%4041180
Diffstat (limited to 'setuptools/command/egg_info.py')
-rwxr-xr-xsetuptools/command/egg_info.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py
index 8577230f..7d0a1473 100755
--- a/setuptools/command/egg_info.py
+++ b/setuptools/command/egg_info.py
@@ -9,7 +9,6 @@ from distutils.errors import *
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 @@ class egg_info(Command):
+
def finalize_options (self):
self.egg_name = safe_name(self.distribution.get_name())
self.egg_version = self.tagged_version()
@@ -149,7 +149,7 @@ class egg_info(Command):
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 @@ class egg_info(Command):
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 @@ class egg_info(Command):
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)