summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2013-11-27 14:12:05 -0500
committerJason R. Coombs <jaraco@jaraco.com>2013-11-27 14:12:05 -0500
commitd52f1865ccc7cc10389ff731ff4e84302fd83010 (patch)
tree68a5b1f5778caf370fb82cc10b360538de65cfaa
parent57bf0b99a118d93749fdeef7aad95c7d82e53be6 (diff)
downloadpython-setuptools-git-d52f1865ccc7cc10389ff731ff4e84302fd83010.tar.gz
Remove easy_install.HAS_USER_SITE and just defer to site.ENABLE_USER_SITE.
-rw-r--r--CHANGES.txt3
-rwxr-xr-xsetuptools/command/easy_install.py14
-rw-r--r--setuptools/tests/test_easy_install.py8
3 files changed, 13 insertions, 12 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index 1331de95..2736d4c1 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -8,6 +8,9 @@ CHANGES
* Issue #41: Dropped support for Python 2.4 and Python 2.5. Clients requiring
setuptools for those versions of Python should use setuptools 1.x.
+* Removed ``setuptools.command.easy_install.HAS_USER_SITE``. Clients
+ expecting this boolean variable should use ``site.ENABLE_USER_SITE``
+ instead.
-----
1.4.1
diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py
index 2f422f47..9775bffc 100755
--- a/setuptools/command/easy_install.py
+++ b/setuptools/command/easy_install.py
@@ -61,8 +61,6 @@ __all__ = [
'main', 'get_exe_prefixes',
]
-HAS_USER_SITE = not sys.version < "2.6" and site.ENABLE_USER_SITE
-
def is_64bit():
return struct.calcsize("P") == 8
@@ -134,7 +132,7 @@ class easy_install(Command):
'no-deps', 'local-snapshots-ok', 'version'
]
- if HAS_USER_SITE:
+ 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')
@@ -143,7 +141,7 @@ class easy_install(Command):
create_index = PackageIndex
def initialize_options(self):
- if HAS_USER_SITE:
+ if site.ENABLE_USER_SITE:
whereami = os.path.abspath(__file__)
self.user = whereami.startswith(site.USER_SITE)
else:
@@ -168,7 +166,7 @@ class easy_install(Command):
self.install_data = None
self.install_base = None
self.install_platbase = None
- if HAS_USER_SITE:
+ if site.ENABLE_USER_SITE:
self.install_userbase = site.USER_BASE
self.install_usersite = site.USER_SITE
else:
@@ -226,13 +224,13 @@ class easy_install(Command):
'abiflags': getattr(sys, 'abiflags', ''),
}
- if HAS_USER_SITE:
+ if site.ENABLE_USER_SITE:
self.config_vars['userbase'] = self.install_userbase
self.config_vars['usersite'] = self.install_usersite
# fix the install_dir if "--user" was used
#XXX: duplicate of the code in the setup command
- if self.user and HAS_USER_SITE:
+ if self.user and site.ENABLE_USER_SITE:
self.create_home_path()
if self.install_userbase is None:
raise DistutilsPlatformError(
@@ -1278,7 +1276,7 @@ def get_site_dirs():
for site_lib in lib_paths:
if site_lib not in sitedirs: sitedirs.append(site_lib)
- if HAS_USER_SITE:
+ if site.ENABLE_USER_SITE:
sitedirs.append(site.USER_SITE)
sitedirs = list(map(normalize_path, sitedirs))
diff --git a/setuptools/tests/test_easy_install.py b/setuptools/tests/test_easy_install.py
index 189e3d55..bb1615d3 100644
--- a/setuptools/tests/test_easy_install.py
+++ b/setuptools/tests/test_easy_install.py
@@ -141,7 +141,7 @@ class TestUserInstallTest(unittest.TestCase):
self.old_cwd = os.getcwd()
os.chdir(self.dir)
if sys.version >= "2.6":
- self.old_has_site = easy_install_pkg.HAS_USER_SITE
+ self.old_enable_site = site.ENABLE_USER_SITE
self.old_file = easy_install_pkg.__file__
self.old_base = site.USER_BASE
site.USER_BASE = tempfile.mkdtemp()
@@ -157,11 +157,11 @@ class TestUserInstallTest(unittest.TestCase):
shutil.rmtree(site.USER_SITE)
site.USER_BASE = self.old_base
site.USER_SITE = self.old_site
- easy_install_pkg.HAS_USER_SITE = self.old_has_site
+ site.ENABLE_USER_SITE = self.old_enable_site
easy_install_pkg.__file__ = self.old_file
def test_user_install_implied(self):
- easy_install_pkg.HAS_USER_SITE = True # disabled sometimes
+ site.ENABLE_USER_SITE = True # disabled sometimes
#XXX: replace with something meaningfull
if sys.version < "2.6":
return #SKIP
@@ -178,7 +178,7 @@ class TestUserInstallTest(unittest.TestCase):
_LOG.info('this should not break')
def test_user_install_not_implied_without_usersite_enabled(self):
- easy_install_pkg.HAS_USER_SITE = False # usually enabled
+ site.ENABLE_USER_SITE = False # usually enabled
#XXX: replace with something meaningfull
if sys.version < "2.6":
return #SKIP