Skip to content

Commit

Permalink
Assume that vcs and direct URL installs need to be reinstalled (#5936)
Browse files Browse the repository at this point in the history
* Assume the vcs and direct URL installs need to be reinstalled
  • Loading branch information
matteius authored Nov 14, 2023
1 parent 9eb07b4 commit 55258f7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 20 deletions.
1 change: 1 addition & 0 deletions news/5936.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Assume the vcs and direct URL installs need to be reinstalled.
24 changes: 4 additions & 20 deletions pipenv/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
from pipenv.patched.pip._vendor.packaging.specifiers import SpecifierSet
from pipenv.patched.pip._vendor.packaging.utils import canonicalize_name
from pipenv.utils import console
from pipenv.utils.constants import VCS_LIST
from pipenv.utils.dependencies import as_pipfile
from pipenv.utils.fileutils import normalize_path, temp_path
from pipenv.utils.funktools import chunked, unnest
from pipenv.utils.indexes import prepare_pip_source_args
Expand Down Expand Up @@ -776,24 +774,10 @@ def is_satisfied(self, req: InstallRequirement):
parsed_url = urlparse(requested_path)
local_path = parsed_url.path
return requested_path and os.path.samefile(local_path, match.location)
elif match.has_metadata("direct_url.json"):
direct_url_metadata = json.loads(match.get_metadata("direct_url.json"))
requested_revision = direct_url_metadata.get("vcs_info", {}).get(
"requested_revision", ""
)
vcs_type = direct_url_metadata.get("vcs_info", {}).get("vcs", "")
_, pipfile_part = as_pipfile(req).popitem()
vcs_ref = ""
for vcs in VCS_LIST:
if pipfile_part.get(vcs):
vcs_ref = pipfile_part[vcs].rsplit("@", 1)[-1]
break
return (
vcs_type == req.link.scheme
and vcs_ref == requested_revision
and direct_url_metadata["url"] == pipfile_part[req.link.scheme]
)
elif req.link.is_vcs:
elif match.has_metadata("direct_url.json") or (req.link and req.link.is_vcs):
# Direct URL installs and VCS installs we assume are not satisfied
# since due to skip-lock we may be installing from Pipfile we have insufficient
# information to determine if a branch or ref has actually changed.
return False
return True
return False
Expand Down

0 comments on commit 55258f7

Please sign in to comment.