Skip to content

Commit

Permalink
Merge pull request #1 from qwcode/rework-commands-v2-qwcode
Browse files Browse the repository at this point in the history
patch dist_in_site_packages for user_site tests
  • Loading branch information
gvalkov committed Nov 19, 2012
2 parents 7746051 + 4c8ac16 commit b4fe4ff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions pip/req.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
import tempfile
import zipfile

import pip

from distutils.util import change_root
from pip.locations import bin_py, running_under_virtualenv
from pip.exceptions import (InstallationError, UninstallationError,
Expand All @@ -19,7 +17,7 @@
from pip.log import logger
from pip.util import display_path, rmtree
from pip.util import ask, ask_path_exists, backup_dir
from pip.util import is_installable_dir, is_local, dist_is_local, dist_in_usersite
from pip.util import is_installable_dir, is_local, dist_is_local, dist_in_usersite, dist_in_site_packages
from pip.util import renames, normalize_path, egg_link_path
from pip.util import make_path_relative
from pip.util import call_subprocess
Expand Down Expand Up @@ -694,7 +692,7 @@ def check_if_exists(self):
if self.use_user_site:
if dist_in_usersite(existing_dist):
self.conflicts_with = existing_dist
elif running_under_virtualenv() and pip.util.dist_in_site_packages(existing_dist):
elif running_under_virtualenv() and dist_in_site_packages(existing_dist):
raise InstallationError("Will not install to the user site because it will lack sys.path precedence to %s in %s"
%(existing_dist.project_name, existing_dist.location))
else:
Expand Down
4 changes: 2 additions & 2 deletions tests/test_user_site.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
patch_dist_in_site_packages = """
def dist_in_site_packages(dist):
return False
import pip
pip.util.dist_in_site_packages=dist_in_site_packages
from pip import req
req.dist_in_site_packages=dist_in_site_packages
"""


Expand Down

0 comments on commit b4fe4ff

Please sign in to comment.