Skip to content

Commit

Permalink
Don't use FileDependency in executor
Browse files Browse the repository at this point in the history
Don't use FileDependency when validating the archive hash in executor,
just compute the hash with the archive path directly.
  • Loading branch information
dunkmann00 committed Dec 7, 2022
1 parent af1687c commit 3858bf0
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/poetry/installation/executor.py
Expand Up @@ -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

Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 3858bf0

Please sign in to comment.