Skip to content

Commit

Permalink
executor: ensure path is used when generating hash
Browse files Browse the repository at this point in the history
  • Loading branch information
abn committed Apr 30, 2021
1 parent 92d92bb commit ccf1322
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion poetry/installation/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,13 @@ def _download_link(self, operation: Union[Install, Update], link: Link) -> Link:
archive = self._chef.prepare(archive)

if package.files:
archive_hash = "sha256:" + FileDependency(package.name, archive).hash()
archive_hash = (
"sha256:"
+ FileDependency(
package.name,
Path(archive.path) if isinstance(archive, Link) else archive,
).hash()
)
if archive_hash not in {f["hash"] for f in package.files}:
raise RuntimeError(
f"Invalid hash for {package} using archive {archive.name}"
Expand Down

0 comments on commit ccf1322

Please sign in to comment.