aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/command
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2020-02-05 21:30:35 -0500
committerGitHub <noreply@github.com>2020-02-05 21:30:35 -0500
commit757deb1a78a8930145da7cf8b9dc7aa48da09a6b (patch)
tree9c1b9b3e6bcbec0ad7c9ab9e6148a3adbadbf0b6 /setuptools/command
parent5d17586a56077dfa3109a5861cf0ff579095a42e (diff)
parent6ee1a1ce60c6d039c63def3c2aeba7e0f39e7507 (diff)
downloadexternal_python_setuptools-757deb1a78a8930145da7cf8b9dc7aa48da09a6b.tar.gz
external_python_setuptools-757deb1a78a8930145da7cf8b9dc7aa48da09a6b.tar.bz2
external_python_setuptools-757deb1a78a8930145da7cf8b9dc7aa48da09a6b.zip
Merge pull request #1941 from joreiff/pr-easyinstall
Make easy_install command less strict (fixes #1405)
Diffstat (limited to 'setuptools/command')
-rw-r--r--setuptools/command/easy_install.py23
1 files changed, 10 insertions, 13 deletions
diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py
index b95ef1f6..abca1ae1 100644
--- a/setuptools/command/easy_install.py
+++ b/setuptools/command/easy_install.py
@@ -157,19 +157,16 @@ class easy_install(Command):
"allow building eggs from local checkouts"),
('version', None, "print version information and exit"),
('no-find-links', None,
- "Don't load find-links defined in packages being installed")
+ "Don't load find-links defined in packages being installed"),
+ ('user', None, "install in user site-package '%s'" % site.USER_SITE)
]
boolean_options = [
'zip-ok', 'multi-version', 'exclude-scripts', 'upgrade', 'always-copy',
'editable',
- 'no-deps', 'local-snapshots-ok', 'version'
+ 'no-deps', 'local-snapshots-ok', 'version',
+ 'user'
]
- if site.ENABLE_USER_SITE:
- help_msg = "install in user site-package '%s'" % site.USER_SITE
- user_options.append(('user', None, help_msg))
- boolean_options.append('user')
-
negative_opt = {'always-unzip': 'zip-ok'}
create_index = PackageIndex
@@ -273,6 +270,9 @@ class easy_install(Command):
self.config_vars['userbase'] = self.install_userbase
self.config_vars['usersite'] = self.install_usersite
+ elif self.user:
+ log.warn("WARNING: The user site-packages directory is disabled.")
+
self._fix_install_dir_for_user_site()
self.expand_basedirs()
@@ -479,8 +479,9 @@ class easy_install(Command):
self.cant_write_to_target()
if not is_site_dir and not self.multi_version:
- # Can't install non-multi to non-site dir
- raise DistutilsError(self.no_default_version_msg())
+ # Can't install non-multi to non-site dir with easy_install
+ pythonpath = os.environ.get('PYTHONPATH', '')
+ log.warn(self.__no_default_msg, self.install_dir, pythonpath)
if is_site_dir:
if self.pth_file is None:
@@ -1311,10 +1312,6 @@ class easy_install(Command):
Please make the appropriate changes for your system and try again.
""").strip()
- def no_default_version_msg(self):
- template = self.__no_default_msg
- return template % (self.install_dir, os.environ.get('PYTHONPATH', ''))
-
def install_site_py(self):
"""Make sure there's a site.py in the target dir, if needed"""