Skip to content

Commit

Permalink
fix: fix exception on invalid url dependency for current env
Browse files Browse the repository at this point in the history
  • Loading branch information
ralbertazzi committed May 19, 2023
1 parent 3602b21 commit ec672ff
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:
# '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.
# The only case in which archive is None is if the original archive is not
# valid for the current environment.
raise ValueError(
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 ec672ff

Please sign in to comment.