aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/command/install.py
diff options
context:
space:
mode:
authorPJ Eby <distutils-sig@python.org>2005-12-16 19:37:21 +0000
committerPJ Eby <distutils-sig@python.org>2005-12-16 19:37:21 +0000
commit646a5b9410d36f9c2ecfb93998d2983f6f33d5d5 (patch)
treed0acce92b3caa52b66df6e2bb3b7b150ee8e4229 /setuptools/command/install.py
parent24e257aa80b93f71dac17ad5d336c63d0f515b4c (diff)
downloadexternal_python_setuptools-646a5b9410d36f9c2ecfb93998d2983f6f33d5d5.tar.gz
external_python_setuptools-646a5b9410d36f9c2ecfb93998d2983f6f33d5d5.tar.bz2
external_python_setuptools-646a5b9410d36f9c2ecfb93998d2983f6f33d5d5.zip
Fix bdist_dumb support to use .egg-info instead of .egg format.
--HG-- branch : setuptools extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/trunk/setuptools%4041716
Diffstat (limited to 'setuptools/command/install.py')
-rw-r--r--setuptools/command/install.py52
1 files changed, 45 insertions, 7 deletions
diff --git a/setuptools/command/install.py b/setuptools/command/install.py
index 760a416c..55321256 100644
--- a/setuptools/command/install.py
+++ b/setuptools/command/install.py
@@ -37,21 +37,51 @@ class install(_install):
" packages"
)
+
+
def handle_extra_path(self):
# We always ignore extra_path, because we install as .egg or .egg-info
self.path_file = None
self.extra_dirs = ''
def run(self):
- if (self.old_and_unmanageable or self.single_version_externally_managed
- or sys._getframe(1).f_globals.get('__name__','') != 'distutils.dist'
- ):
- # Either we were asked for the old behavior, or we're not being
- # run from the command line. This is a bit kludgy, because a
- # command might use dist.run_command() to run 'install', but
- # bdist_dumb and bdist_wininst both call run() directly right now.
+ # Explicit request for old-style install? Just do it
+ if self.old_and_unmanageable or self.single_version_externally_managed:
return _install.run(self)
+ # Attempt to detect whether we were called from setup() or by another
+ # command. If we were called by setup(), our caller will be the
+ # 'run_command' method in 'distutils.dist', and *its* caller will be
+ # the 'run_commands' method. If we were called any other way, our
+ # immediate caller *might* be 'run_command', but it won't have been
+ # called by 'run_commands'. This is slightly kludgy, but seems to
+ # work.
+ #
+ caller = sys._getframe(2)
+ caller_module = caller.f_globals.get('__name__','')
+ caller_name = caller.f_code.co_name
+
+ if caller_module != 'distutils.dist' or caller_name!='run_commands':
+ # We weren't called from the command line or setup(), so we
+ # should run in backward-compatibility mode to support bdist_*
+ # commands.
+ _install.run(self)
+ else:
+ self.do_egg_install()
+
+
+
+
+
+
+
+
+
+
+
+
+ def do_egg_install(self):
+
from setuptools.command.easy_install import easy_install
cmd = easy_install(
@@ -83,3 +113,11 @@ class install(_install):
+
+
+
+
+
+
+
+