From 3858bf09280a9f2f27e56cb4b557b38ff72fbb52 Mon Sep 17 00:00:00 2001 From: George Waters Date: Wed, 7 Dec 2022 10:33:41 -0500 Subject: [PATCH] Don't use FileDependency in executor Don't use FileDependency when validating the archive hash in executor, just compute the hash with the archive path directly. --- src/poetry/installation/executor.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/poetry/installation/executor.py b/src/poetry/installation/executor.py index b3b298caa20..6df976f7c45 100644 --- a/src/poetry/installation/executor.py +++ b/src/poetry/installation/executor.py @@ -15,7 +15,6 @@ from typing import Any from cleo.io.null_io import NullIO -from poetry.core.packages.file_dependency import FileDependency from poetry.core.packages.utils.link import Link from poetry.core.pyproject.toml import PyProjectTOML @@ -667,8 +666,7 @@ def _download_link(self, operation: Install | Update, link: Link) -> Path: @staticmethod def _validate_archive_hash(archive: Path, package: Package) -> str: - file_dep = FileDependency(package.name, archive) - archive_hash: str = "sha256:" + get_file_hash(file_dep.full_path) + archive_hash: str = "sha256:" + get_file_hash(archive) known_hashes = {f["hash"] for f in package.files} if archive_hash not in known_hashes: