Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/poetry/installation/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -780,9 +780,15 @@ def _download_link(self, operation: Install | Update, link: Link) -> Path:
strict=False,
env=self._env,
)
# 'archive' can at this point never be None. Since we previously downloaded
# an archive, we now should have something cached that we can use here
assert archive is not None
if archive is None:
# Since we previously downloaded an archive, we now should have
# something cached that we can use here. The only case in which
# archive is None is if the original archive is not valid for the
# current environment.
raise RuntimeError(
f"Package {link.url} cannot be installed in the current environment"
f" {self._env.marker_env}"
)

if archive.suffix != ".whl":
message = (
Expand Down