Skip to content

Commit 0de1903

Browse files
committed
reintroduce record content validation
1 parent 4a263a3 commit 0de1903

2 files changed

Lines changed: 7 additions & 10 deletions

File tree

src/poetry/installation/wheel_installer.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,7 @@ def enable_bytecode_compilation(self, enable: bool = True) -> None:
102102
def install(self, wheel: Path) -> None:
103103
with WheelFile.open(wheel) as source:
104104
try:
105-
# Content validation is temporarily disabled because of
106-
# pypa/installer's out of memory issues with big wheels. See
107-
# https://github.com/python-poetry/poetry/issues/7983
108-
source.validate_record(validate_contents=False)
105+
source.validate_record()
109106
except _WheelFileValidationError as e:
110107
self.invalid_wheels[wheel] = e.issues
111108

tests/installation/test_executor.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -503,37 +503,37 @@ def test_execute_prints_warning_for_yanked_package(
503503
assert error.count("yanked") == 0
504504

505505

506-
@pytest.mark.skip(reason="https://github.com/python-poetry/poetry/issues/7983")
507506
def test_execute_prints_warning_for_invalid_wheels(
508507
config: Config,
509508
pool: RepositoryPool,
510509
io: BufferedIO,
511510
tmp_path: Path,
512511
env: MockEnv,
512+
fixture_dir: FixtureDirGetter,
513513
) -> None:
514514
config.merge({"cache-dir": str(tmp_path)})
515515

516516
executor = Executor(env, pool, config, io)
517517

518-
base_url = "https://files.pythonhosted.org/"
519518
wheel1 = "demo_invalid_record-0.1.0-py2.py3-none-any.whl"
520519
wheel2 = "demo_invalid_record2-0.1.0-py2.py3-none-any.whl"
520+
dist_dir = fixture_dir("distributions")
521521
return_code = executor.execute(
522522
[
523523
Install(
524524
Package(
525525
"demo-invalid-record",
526526
"0.1.0",
527-
source_type="url",
528-
source_url=f"{base_url}/{wheel1}",
527+
source_type="file",
528+
source_url=(dist_dir / wheel1).resolve().as_posix(),
529529
)
530530
),
531531
Install(
532532
Package(
533533
"demo-invalid-record2",
534534
"0.1.0",
535-
source_type="url",
536-
source_url=f"{base_url}/{wheel2}",
535+
source_type="file",
536+
source_url=(dist_dir / wheel2).resolve().as_posix(),
537537
)
538538
),
539539
]

0 commit comments

Comments
 (0)