Merge pull request #5951 from fmssn/main

Catch req.link = None
This commit is contained in:
Matt Davis
2023-09-28 23:05:25 -04:00
committed by GitHub
+8 -6
View File
@@ -769,7 +769,13 @@ class Environment:
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
@@ -794,12 +800,8 @@ class Environment:
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