Skip to content

Commit

Permalink
Merge pull request #5951 from fmssn/main
Browse files Browse the repository at this point in the history
Catch req.link = None
  • Loading branch information
matteius authored Sep 29, 2023
2 parents f5032e9 + 85c1ba5 commit b6163a8
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions pipenv/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,13 @@ def is_satisfied(self, req: InstallRequirement):
None,
)
if match is not None:
if req.editable and req.link and req.link.is_file:
if req.specifier is not None:
return SpecifierSet(str(req.specifier)).contains(
match.version, prereleases=True
)
if req.link is None:
return True
elif req.editable and req.link.is_file:
requested_path = req.link.file_path
if os.path.exists(requested_path):
local_path = requested_path
Expand All @@ -794,12 +800,8 @@ def is_satisfied(self, req: InstallRequirement):
and vcs_ref == requested_revision
and direct_url_metadata["url"] == pipfile_part[req.link.scheme]
)
elif req.link and req.link.is_vcs:
elif req.link.is_vcs:
return False
elif req.specifier is not None:
return SpecifierSet(str(req.specifier)).contains(
match.version, prereleases=True
)
return True
return False

Expand Down

0 comments on commit b6163a8

Please sign in to comment.