aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/command/egg_info.py
diff options
context:
space:
mode:
authorPJ Eby <distutils-sig@python.org>2005-12-30 16:35:42 +0000
committerPJ Eby <distutils-sig@python.org>2005-12-30 16:35:42 +0000
commitdef626a4f5aa9c03da1fc2418fcad8055687f4b1 (patch)
tree8b14f95d2c00befbb39e9c71c8aeff584c9b6959 /setuptools/command/egg_info.py
parent839a5f3185aa83187c66a2f190f3daab36803a5f (diff)
downloadexternal_python_setuptools-def626a4f5aa9c03da1fc2418fcad8055687f4b1.tar.gz
external_python_setuptools-def626a4f5aa9c03da1fc2418fcad8055687f4b1.tar.bz2
external_python_setuptools-def626a4f5aa9c03da1fc2418fcad8055687f4b1.zip
Allow most commands to work with an existing .egg-info directory w/a '-'
in it, but warn about it and refuse to run "develop" until the existing directory is renamed. This should allow older source distributions and checkouts to keep working with 0.6a9. --HG-- branch : setuptools extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/trunk/setuptools%4041857
Diffstat (limited to 'setuptools/command/egg_info.py')
-rwxr-xr-xsetuptools/command/egg_info.py35
1 files changed, 18 insertions, 17 deletions
diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py
index 9d39b79b..e5f95d4f 100755
--- a/setuptools/command/egg_info.py
+++ b/setuptools/command/egg_info.py
@@ -37,7 +37,7 @@ class egg_info(Command):
self.tag_build = None
self.tag_svn_revision = 0
self.tag_date = 0
-
+ self.broken_egg_info = False
def finalize_options (self):
self.egg_name = safe_name(self.distribution.get_name())
@@ -61,6 +61,7 @@ class egg_info(Command):
self.egg_info = self.egg_name.replace('-','_')+'.egg-info'
if self.egg_base != os.curdir:
self.egg_info = os.path.join(self.egg_base, self.egg_info)
+ if '-' in self.egg_name: self.check_broken_egg_info()
# Set package version for the benefit of dumber commands
# (e.g. sdist, bdist_wininst, etc.)
@@ -79,7 +80,6 @@ class egg_info(Command):
-
def write_or_delete_file(self, what, filename, data):
"""Write `data` to `filename` or delete if empty
@@ -170,6 +170,20 @@ class egg_info(Command):
mm.run()
self.filelist = mm.filelist
+ def check_broken_egg_info(self):
+ bei = self.egg_name+'.egg-info'
+ if self.egg_base != os.curdir:
+ bei = os.path.join(self.egg_base, bei)
+ if os.path.exists(bei):
+ log.warn(
+ "-"*78+'\n'
+ "Note: Your current .egg-info directory has a '-' in its name;"
+ '\nthis will not work correctly with "setup.py develop".\n\n'
+ 'Please rename %s to %s to correct this problem.\n'+'-'*78,
+ bei, self.egg_info
+ )
+ self.broken_egg_info = self.egg_info
+ self.egg_info = bei # make it work for now
class FileList(FileList):
"""File list that accepts only existing, platform-independent paths"""
@@ -190,23 +204,10 @@ class FileList(FileList):
-
-
-
-
-
-
-
-
-
-
-
-
-
class manifest_maker(sdist):
template = "MANIFEST.in"
-
+
def initialize_options (self):
self.use_defaults = 1
self.prune = 1
@@ -300,7 +301,7 @@ def write_pkg_info(cmd, basename, filename):
safe = getattr(cmd.distribution,'zip_safe',None)
import bdist_egg; bdist_egg.write_safety_flag(cmd.egg_info, safe)
-
+
def warn_depends_obsolete(cmd, basename, filename):
if os.path.exists(filename):
log.warn(