File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -687,6 +687,9 @@ def _build_link_map(entries):
687687 version_by_pkg = {}
688688
689689 for entry in entries :
690+ # We overwrite duplicates by design. The dependency closer to the
691+ # binary gets precedence due to the topological ordering.
692+
690693 package = ""
691694 if entry .package :
692695 # We have normalized the version/package to PEP440 spec
@@ -697,18 +700,13 @@ def _build_link_map(entries):
697700 # previously added values.
698701 version_by_pkg [package ] = version
699702
700- # Ensure that we start fresh
703+ # Overwrite any existing values because this is closer to the terminal
704+ # node
701705 pkg_link_map .pop (package , None )
702706
707+ # Overwrite any existing values because this is closer to the terminal node
703708 link_map = pkg_link_map .setdefault (package , {})
704-
705- kind = entry .kind
706- kind_map = link_map .setdefault (kind , {})
707-
708- # We overwrite duplicates by design. The dependency closer to the
709- # binary gets precedence due to the topological ordering.
710- #
711- # This allows us to store only one version of the dist-info that is needed
709+ kind_map = link_map .setdefault (entry .kind , {})
712710 kind_map [entry .venv_path ] = entry .link_to_path
713711
714712 # An empty link_to value means to not create the site package symlink.
You can’t perform that action at this time.
0 commit comments