summaryrefslogtreecommitdiff
path: root/setuptools/command/develop.py
diff options
context:
space:
mode:
authorPJ Eby <distutils-sig@python.org>2007-02-23 20:29:58 +0000
committerPJ Eby <distutils-sig@python.org>2007-02-23 20:29:58 +0000
commitfb98a95e9badb23765ea520fd5bd9e30d0f1fe4a (patch)
tree605688714635990d2fb8fc117ca69a91eedf79ea /setuptools/command/develop.py
parentaba13220b952cd60df2a8f7cf44394d28a5f1814 (diff)
downloadpython-setuptools-git-fb98a95e9badb23765ea520fd5bd9e30d0f1fe4a.tar.gz
Added ``--local-snapshots-ok`` flag, to allow building eggs from
projects installed using ``setup.py develop``. (backport from trunk) --HG-- branch : setuptools-0.6 extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/branches/setuptools-0.6%4053877
Diffstat (limited to 'setuptools/command/develop.py')
-rwxr-xr-xsetuptools/command/develop.py26
1 files changed, 13 insertions, 13 deletions
diff --git a/setuptools/command/develop.py b/setuptools/command/develop.py
index 4e19e07a..dfc41764 100755
--- a/setuptools/command/develop.py
+++ b/setuptools/command/develop.py
@@ -31,7 +31,7 @@ class develop(easy_install):
self.uninstall = None
self.egg_path = None
easy_install.initialize_options(self)
-
+ self.setup_path = None
@@ -61,6 +61,7 @@ class develop(easy_install):
" directory to "+target
)
+
# Make a distribution for the package's source
self.dist = Distribution(
target,
@@ -68,16 +69,15 @@ class develop(easy_install):
project_name = ei.egg_name
)
-
-
-
-
-
-
-
-
-
-
+ p = self.egg_base.replace(os.sep,'/')
+ if p!= os.curdir:
+ p = '../' * (p.count('/')+1)
+ self.setup_path = p
+ p = normalize_path(os.path.join(self.install_dir, self.egg_path, p))
+ if p != normalize_path(os.curdir):
+ raise DistutilsOptionError(
+ "Can't get a consistent path to setup script from"
+ " installation directory", p, normalize_path(os.curdir))
def install_for_development(self):
@@ -95,7 +95,7 @@ class develop(easy_install):
log.info("Creating %s (link to %s)", self.egg_link, self.egg_base)
if not self.dry_run:
f = open(self.egg_link,"w")
- f.write(self.egg_path)
+ f.write(self.egg_path + "\n" + self.setup_path)
f.close()
# postprocess the installed distro, fixing up .pth, installing scripts,
# and handling requirements
@@ -106,7 +106,7 @@ class develop(easy_install):
if os.path.exists(self.egg_link):
log.info("Removing %s (link to %s)", self.egg_link, self.egg_base)
contents = [line.rstrip() for line in file(self.egg_link)]
- if contents != [self.egg_path]:
+ if contents not in ([self.egg_path], [self.egg_path, self.setup_path]):
log.warn("Link points to %s: uninstall aborted", contents)
return
if not self.dry_run: