Skip to content

Commit

Permalink
feat: always use sha256 for pep610 archive_info
Browse files Browse the repository at this point in the history
  • Loading branch information
neersighted committed Nov 15, 2021
1 parent 9d5dcf1 commit 5e2d872
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/poetry/installation/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,14 @@ def _validate_archive_hash(archive: Union[Path, Link], package: Package) -> str:
)
)

return archive_hashes.pop()
try:
_, sha256 = next(
filter(lambda h: h.startswith("sha256:"), archive_hashes)
).split(":")
except StopIteration:
sha256 = file_dep.hash("sha256")

return f"sha256={sha256}"

def _download_archive(self, operation: Union[Install, Update], link: Link) -> Path:
response = self._authenticator.request(
Expand Down

0 comments on commit 5e2d872

Please sign in to comment.