Skip to content

Commit

Permalink
fix: fix exception on invalid url dependency for current env (#7953)
Browse files Browse the repository at this point in the history
  • Loading branch information
ralbertazzi authored May 19, 2023
1 parent 277fa60 commit a5f542b
Showing 1 changed file with 9 additions and 3 deletions.
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

0 comments on commit a5f542b

Please sign in to comment.