Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assume that vcs and direct URL installs need to be reinstalled #5936

Merged
merged 4 commits into from
Nov 14, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 4 additions & 20 deletions pipenv/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,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 @@ -777,24 +775,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 and 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
elif req.specifier is not None:
return SpecifierSet(str(req.specifier)).contains(
Expand Down