1
1
Fork 0
mirror of https://github.com/pypa/pip synced 2023-12-13 21:30:23 +01:00

Always check_if_exists for editable

But only when pip has collected the editable package's metadata.

closes #1548
This commit is contained in:
Xavier Fernandez 2016-08-05 22:42:22 +02:00
parent 73fc56e613
commit 65a82a2eb0
3 changed files with 29 additions and 1 deletions

View file

@ -1,5 +1,8 @@
**8.2.0 (unreleased)**
* Uninstall existing packages when performing an editable installation of
the same packages (:issue:`1548`).
* Pip show is less verbose by default. `--verbose` prints multiline fields
* Added optional column formatting to ``pip list`` (:issue:`3651`).

View file

@ -489,6 +489,7 @@ class RequirementSet(object):
abstract_dist.prep_for_dist()
if self.is_download:
req_to_install.archive(self.download_dir)
req_to_install.check_if_exists()
elif req_to_install.satisfied_by:
if require_hashes:
logger.debug(

View file

@ -201,10 +201,34 @@ def test_install_editable_uninstalls_existing(data, script, tmpdir):
)
result.assert_installed('pip-test-package', with_files=['.git'])
assert 'Found existing installation: pip-test-package 0.1' in result.stdout
assert 'Uninstalling pip-test-package:' in result.stdout
assert 'Uninstalling pip-test-package-' in result.stdout
assert 'Successfully uninstalled pip-test-package' in result.stdout
def test_install_editable_uninstalls_existing_from_path(script, data):
"""
Test that installing an editable uninstalls a previously installed
non-editable version from path
"""
to_install = data.src.join('simplewheel-1.0')
result = script.pip_install_local(to_install)
assert 'Successfully installed simplewheel' in result.stdout
simple_folder = script.site_packages / 'simple'
result.assert_installed('simple', editable=False)
assert simple_folder in result.files_created, str(result.stdout)
result = script.pip(
'install', '-e',
to_install,
)
install_path = script.site_packages / 'simplewheel.egg-link'
assert install_path in result.files_created, str(result)
assert 'Found existing installation: simplewheel 1.0' in result.stdout
assert 'Uninstalling simplewheel-' in result.stdout
assert 'Successfully uninstalled simplewheel' in result.stdout
assert simple_folder in result.files_deleted, str(result.stdout)
def test_install_editable_from_hg(script, tmpdir):
"""Test cloning from Mercurial."""
pkg_path = _create_test_package(script, name='testpackage', vcs='hg')