mirror of
https://github.com/pypa/pip
synced 2023-12-13 21:30:23 +01:00
Merge pull request #7519 from chrahunt/bugfix/restrict-two-dist-info-dirs-toplevel-only
Only check for .dist-info directories at the top-level
This commit is contained in:
commit
dc860e865e
|
@ -383,6 +383,7 @@ def install_unpacked_wheel(
|
|||
continue
|
||||
elif (
|
||||
is_base and
|
||||
basedir == '' and
|
||||
s.endswith('.dist-info')
|
||||
):
|
||||
assert not info_dir, (
|
||||
|
|
|
@ -472,3 +472,20 @@ def test_wheel_install_fails_with_unrelated_dist_info(script):
|
|||
"'simple-0.1.0.dist-info' does not start with 'unrelated'"
|
||||
in result.stderr
|
||||
)
|
||||
|
||||
|
||||
def test_wheel_installs_ok_with_nested_dist_info(script):
|
||||
package = create_basic_wheel_for_package(
|
||||
script,
|
||||
"simple",
|
||||
"0.1.0",
|
||||
extra_files={
|
||||
"subdir/unrelated-2.0.0.dist-info/WHEEL": "Wheel-Version: 1.0",
|
||||
"subdir/unrelated-2.0.0.dist-info/METADATA": (
|
||||
"Name: unrelated\nVersion: 2.0.0\n"
|
||||
),
|
||||
},
|
||||
)
|
||||
script.pip(
|
||||
"install", "--no-cache-dir", "--no-index", package
|
||||
)
|
||||
|
|
|
@ -997,7 +997,7 @@ def create_basic_wheel_for_package(
|
|||
|
||||
for fname in files:
|
||||
path = script.temp_path / fname
|
||||
path.parent.mkdir(exist_ok=True)
|
||||
path.parent.mkdir(exist_ok=True, parents=True)
|
||||
path.write_text(files[fname])
|
||||
|
||||
retval = script.scratch_path / archive_name
|
||||
|
|
Loading…
Reference in a new issue