Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for #295 install -I when package installed #296

Merged
merged 1 commit into from Jun 5, 2011
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion pip/req.py
Expand Up @@ -997,7 +997,7 @@ def prepare_files(self, finder, force_root_egg_info=False, bundle=False):
# repeat check_if_exists to uninstall-on-upgrade (#14)
req_to_install.check_if_exists()
if req_to_install.satisfied_by:
if self.upgrade:
if self.upgrade or self.ignore_installed:
req_to_install.conflicts_with = req_to_install.satisfied_by
req_to_install.satisfied_by = None
else:
Expand Down
11 changes: 11 additions & 0 deletions tests/test_upgrade.py
Expand Up @@ -149,3 +149,14 @@ def test_should_not_install_always_from_cache():
result = run_pip('install', 'INITools==0.1', expect_error=True)
assert env.site_packages/'INITools-0.2-py%s.egg-info' % pyversion not in result.files_created
assert env.site_packages/'INITools-0.1-py%s.egg-info' % pyversion in result.files_created

def test_install_with_ignoreinstalled_requested():
"""
It installs package if ignore installed is set.

"""
env = reset_env()
run_pip('install', 'INITools==0.1', expect_error=True)
result = run_pip('install', '-I' , 'INITools', expect_error=True)
assert result.files_created, 'pip install -I did not install'
assert env.site_packages/'INITools-0.1-py%s.egg-info' % pyversion not in result.files_created