Skip to content

Commit

Permalink
Refactor to correct both known failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
matteius committed Oct 26, 2024
1 parent 4eabddc commit fe1741f
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions pipenv/utils/locking.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from typing import Any, Dict, Iterator, List, Optional, Set, Tuple

from pipenv.patched.pip._internal.req.req_install import InstallRequirement
from pipenv.utils.constants import VCS_LIST
from pipenv.utils.dependencies import (
clean_resolved_dep,
determine_vcs_revision_hash,
Expand Down Expand Up @@ -54,12 +55,14 @@ def format_requirement_for_lockfile(
entry: Dict[str, Any] = {"name": name}
pipfile_entry = pipfile_entries.get(name, pipfile_entries.get(req.name, {}))
# Handle VCS requirements
link = None
is_vcs_dep = next(iter([vcs for vcs in VCS_LIST if vcs in pipfile_entry]), None)
if req.link and req.link.is_vcs:
link = req.link
elif req.cached_wheel_source_link:
link = req.cached_wheel_source_link
if link:
is_vcs_dep = True
if is_vcs_dep:
if req.link and req.link.is_vcs:
link = req.link
else:
link = req.cached_wheel_source_link
vcs = link.scheme.split("+", 1)[0]

# Get VCS URL from original deps or normalize the link URL
Expand Down

0 comments on commit fe1741f

Please sign in to comment.