Skip to content

Commit

Permalink
Merge pull request pypa#3308 from xavfernandez/user_implies_null_pref…
Browse files Browse the repository at this point in the history
…ix_again

Fix regression on --user install with (accidental) prefix
  • Loading branch information
xavfernandez committed Dec 27, 2015
2 parents 9974f27 + d9e0a05 commit e1a9780
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions pip/locations.py
Expand Up @@ -177,6 +177,8 @@ def distutils_scheme(dist_name, user=False, home=None, root=None,
# ideally, we'd prefer a scheme class that has no side-effects.
assert not (user and prefix), "Got user and prefix {}".format(user, prefix)
i.user = user or i.user
if user:
i.prefix = ""
i.prefix = prefix or i.prefix
i.home = home or i.home
i.root = root or i.root
Expand Down
7 changes: 6 additions & 1 deletion tests/functional/test_install_reqs.py
Expand Up @@ -191,7 +191,10 @@ def test_install_local_editable_with_subdirectory(script):
result.assert_installed('version-subpkg', sub_dir='version_subdir')


def test_user_with_prefix_in_pydistutils_cfg(script, data, virtualenv):
@pytest.mark.network
def test_wheel_user_with_prefix_in_pydistutils_cfg(script, data, virtualenv):
# Make sure wheel is available in the virtualenv
script.pip('install', 'wheel')
virtualenv.system_site_packages = True
homedir = script.environ["HOME"]
script.scratch_path.join("bin").mkdir()
Expand All @@ -202,6 +205,8 @@ def test_user_with_prefix_in_pydistutils_cfg(script, data, virtualenv):

result = script.pip('install', '--user', '--no-index', '-f',
data.find_links, 'requiresupper')
# Check that we are really installing a wheel
assert 'Running setup.py install for requiresupper' not in result.stdout
assert 'installed requiresupper' in result.stdout


Expand Down

0 comments on commit e1a9780

Please sign in to comment.