mirror of https://github.com/pypa/pip
Merge pull request #9274 from sbidoul/pip-wheel-must-keep-clone-sbi
This commit is contained in:
commit
3af9093a73
|
@ -0,0 +1,3 @@
|
||||||
|
Fix a regression that made ``pip wheel`` do a VCS export instead of a VCS clone
|
||||||
|
for editable requirements. This broke VCS requirements that need the VCS
|
||||||
|
information to build correctly.
|
|
@ -0,0 +1,2 @@
|
||||||
|
Fix ``pip download`` of editable VCS requirements that need VCS information
|
||||||
|
to build correctly.
|
|
@ -0,0 +1,2 @@
|
||||||
|
Remove the VCS export feature that was used only with editable VCS
|
||||||
|
requirements and had correctness issues.
|
|
@ -547,7 +547,7 @@ class RequirementPreparer:
|
||||||
'hash.'.format(req)
|
'hash.'.format(req)
|
||||||
)
|
)
|
||||||
req.ensure_has_source_dir(self.src_dir)
|
req.ensure_has_source_dir(self.src_dir)
|
||||||
req.update_editable(self.download_dir is None)
|
req.update_editable()
|
||||||
|
|
||||||
dist = _get_prepared_distribution(
|
dist = _get_prepared_distribution(
|
||||||
req, self.req_tracker, self.finder, self.build_isolation,
|
req, self.req_tracker, self.finder, self.build_isolation,
|
||||||
|
|
|
@ -611,8 +611,8 @@ class InstallRequirement:
|
||||||
)
|
)
|
||||||
|
|
||||||
# For editable installations
|
# For editable installations
|
||||||
def update_editable(self, obtain=True):
|
def update_editable(self):
|
||||||
# type: (bool) -> None
|
# type: () -> None
|
||||||
if not self.link:
|
if not self.link:
|
||||||
logger.debug(
|
logger.debug(
|
||||||
"Cannot update repository at %s; repository location is "
|
"Cannot update repository at %s; repository location is "
|
||||||
|
@ -645,10 +645,7 @@ class InstallRequirement:
|
||||||
)
|
)
|
||||||
deprecated(reason, replacement, gone_in="21.0", issue=7554)
|
deprecated(reason, replacement, gone_in="21.0", issue=7554)
|
||||||
hidden_url = hide_url(self.link.url)
|
hidden_url = hide_url(self.link.url)
|
||||||
if obtain:
|
vcs_backend.obtain(self.source_dir, url=hidden_url)
|
||||||
vcs_backend.obtain(self.source_dir, url=hidden_url)
|
|
||||||
else:
|
|
||||||
vcs_backend.export(self.source_dir, url=hidden_url)
|
|
||||||
else:
|
else:
|
||||||
assert 0, (
|
assert 0, (
|
||||||
'Unexpected version control type (in {}): {}'.format(
|
'Unexpected version control type (in {}): {}'.format(
|
||||||
|
|
|
@ -169,6 +169,25 @@ def test_pip_wheel_builds_editable(script, data):
|
||||||
result.did_create(wheel_file_path)
|
result.did_create(wheel_file_path)
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.network
|
||||||
|
def test_pip_wheel_git_editable_keeps_clone(script, tmpdir):
|
||||||
|
"""
|
||||||
|
Test that `pip wheel -e giturl` preserves a git clone in src.
|
||||||
|
"""
|
||||||
|
script.pip(
|
||||||
|
'wheel',
|
||||||
|
'--no-deps',
|
||||||
|
'-e',
|
||||||
|
'git+https://github.com/pypa/pip-test-package#egg=pip-test-package',
|
||||||
|
'--src',
|
||||||
|
tmpdir / 'src',
|
||||||
|
'--wheel-dir',
|
||||||
|
tmpdir,
|
||||||
|
)
|
||||||
|
assert (tmpdir / 'src' / 'pip-test-package').exists()
|
||||||
|
assert (tmpdir / 'src' / 'pip-test-package' / '.git').exists()
|
||||||
|
|
||||||
|
|
||||||
def test_pip_wheel_builds_editable_does_not_create_zip(script, data, tmpdir):
|
def test_pip_wheel_builds_editable_does_not_create_zip(script, data, tmpdir):
|
||||||
"""
|
"""
|
||||||
Test 'pip wheel' of editables does not create zip files
|
Test 'pip wheel' of editables does not create zip files
|
||||||
|
|
Loading…
Reference in New Issue