aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/command/develop.py
diff options
context:
space:
mode:
authorPJ Eby <distutils-sig@python.org>2007-02-15 19:22:19 +0000
committerPJ Eby <distutils-sig@python.org>2007-02-15 19:22:19 +0000
commit7a27a6f7256169366cc968f75d6854754b29585d (patch)
tree375f18ef5d2e2e7dbe428aeb6eabb1c345f3cebd /setuptools/command/develop.py
parenta494dd32ae6289c1855bd4a57eb20861acbb6aa8 (diff)
downloadexternal_python_setuptools-7a27a6f7256169366cc968f75d6854754b29585d.tar.gz
external_python_setuptools-7a27a6f7256169366cc968f75d6854754b29585d.tar.bz2
external_python_setuptools-7a27a6f7256169366cc968f75d6854754b29585d.zip
Added ``--egg-path`` option to ``develop`` command, allowing you to force
``.egg-link`` files to use relative paths (allowing them to be shared across platforms on a networked drive). (backport from trunk) --HG-- branch : setuptools-0.6 extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/branches/setuptools-0.6%4053791
Diffstat (limited to 'setuptools/command/develop.py')
-rwxr-xr-xsetuptools/command/develop.py53
1 files changed, 47 insertions, 6 deletions
diff --git a/setuptools/command/develop.py b/setuptools/command/develop.py
index fc35ad85..4e19e07a 100755
--- a/setuptools/command/develop.py
+++ b/setuptools/command/develop.py
@@ -12,6 +12,7 @@ class develop(easy_install):
user_options = easy_install.user_options + [
("uninstall", "u", "Uninstall this source package"),
+ ("egg-path=", None, "Set the path to be used in the .egg-link file"),
]
boolean_options = easy_install.boolean_options + ['uninstall']
@@ -28,6 +29,7 @@ class develop(easy_install):
def initialize_options(self):
self.uninstall = None
+ self.egg_path = None
easy_install.initialize_options(self)
@@ -37,8 +39,6 @@ class develop(easy_install):
-
-
def finalize_options(self):
ei = self.get_finalized_command("egg_info")
if ei.broken_egg_info:
@@ -50,14 +50,36 @@ class develop(easy_install):
easy_install.finalize_options(self)
self.egg_link = os.path.join(self.install_dir, ei.egg_name+'.egg-link')
self.egg_base = ei.egg_base
- self.egg_path = os.path.abspath(ei.egg_base)
+
+ if self.egg_path is None:
+ self.egg_path = os.path.abspath(ei.egg_base)
+
+ target = normalize_path(self.egg_base)
+ if normalize_path(os.path.join(self.install_dir, self.egg_path)) != target:
+ raise DistutilsOptionError(
+ "--egg-path must be a relative path from the install"
+ " directory to "+target
+ )
+
# Make a distribution for the package's source
self.dist = Distribution(
- normalize_path(self.egg_path),
- PathMetadata(self.egg_path, os.path.abspath(ei.egg_info)),
+ target,
+ PathMetadata(target, os.path.abspath(ei.egg_info)),
project_name = ei.egg_name
)
+
+
+
+
+
+
+
+
+
+
+
+
def install_for_development(self):
# Ensure metadata is up-to-date
self.run_command('egg_info')
@@ -75,11 +97,11 @@ class develop(easy_install):
f = open(self.egg_link,"w")
f.write(self.egg_path)
f.close()
-
# postprocess the installed distro, fixing up .pth, installing scripts,
# and handling requirements
self.process_distribution(None, self.dist, not self.no_deps)
+
def uninstall_link(self):
if os.path.exists(self.egg_link):
log.info("Removing %s (link to %s)", self.egg_link, self.egg_base)
@@ -96,6 +118,9 @@ class develop(easy_install):
log.warn("Note: you must uninstall or replace scripts manually!")
+
+
+
def install_egg_scripts(self, dist):
if dist is not self.dist:
# Installing a dependency, so fall back to normal behavior
@@ -121,3 +146,19 @@ class develop(easy_install):
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+