aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/command/easy_install.py
diff options
context:
space:
mode:
authorErik Bray <embray@stsci.edu>2011-08-30 12:34:37 -0400
committerErik Bray <embray@stsci.edu>2011-08-30 12:34:37 -0400
commitb568b2ffb5d4e5c767452fce2353adec70d93a00 (patch)
tree00cedcca8bf3b3cf6c160fa3f8ec1f3315858bc3 /setuptools/command/easy_install.py
parent0da4543c2641cb04affb1d9b9e1d15f6e4f3fbea (diff)
downloadexternal_python_setuptools-b568b2ffb5d4e5c767452fce2353adec70d93a00.tar.gz
external_python_setuptools-b568b2ffb5d4e5c767452fce2353adec70d93a00.tar.bz2
external_python_setuptools-b568b2ffb5d4e5c767452fce2353adec70d93a00.zip
First stab at a fix. The hack that allows it to work is that it allows the easy_install command to take a '-' argument which simply means 'don't run', so that arguments can be passed to the easy_install command from the comannd line without running it.
--HG-- branch : distribute extra : rebase_source : 6eff3586cbcf36e846b3419218979d03079d1bcf
Diffstat (limited to 'setuptools/command/easy_install.py')
-rwxr-xr-xsetuptools/command/easy_install.py22
1 files changed, 21 insertions, 1 deletions
diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py
index 853753c1..3f1b4228 100755
--- a/setuptools/command/easy_install.py
+++ b/setuptools/command/easy_install.py
@@ -267,7 +267,8 @@ class easy_install(Command):
)
else:
self.all_site_dirs.append(normalize_path(d))
- if not self.editable: self.check_site_dir()
+ if not self.editable and self.args != ['-']:
+ self.check_site_dir()
self.index_url = self.index_url or "http://pypi.python.org/simple"
self.shadow_path = self.all_site_dirs[:]
for path_item in self.install_dir, normalize_path(self.script_dir):
@@ -338,6 +339,11 @@ class easy_install(Command):
'install_scripts', 'install_data',])
def run(self):
+ if self.args == ['-']:
+ # A single dash as an argument means 'do nothing' and is just a way
+ # to pass arguments to the easy_install command without running it
+ return
+
if self.verbose != self.distribution.verbose:
log.set_verbosity(self.verbose)
try:
@@ -1079,6 +1085,20 @@ See the setuptools documentation for the "develop" command for more info.
)
try:
args.append(dist_dir)
+ ei_opts = self.distribution.get_option_dict('easy_install').copy()
+ keep = (
+ 'find_links', 'site_dirs', 'index_url', 'optimize',
+ 'site_dirs', 'allow_hosts'
+ )
+ for key in ei_opts.keys():
+ if key not in keep:
+ del ei_opts[key]
+ if ei_opts:
+ args.append('easy_install')
+ for key, val in ei_opts.iteritems():
+ args.append('--%s=%s' % (key.replace('_', '-'), val[1]))
+ args.append('-')
+
self.run_setup(setup_script, setup_base, args)
all_eggs = Environment([dist_dir])
eggs = []