Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 3 additions & 1 deletion python/private/venv_runfiles.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,9 @@ def _group_venv_path_entries(entries):
"""

# Sort so order is top-down, ensuring grouping by short common prefix
entries = sorted(entries, key = lambda e: e.venv_path)
# Split it into path components so `foo foo-bar foo/bar` sorts as
# `foo foo/bar foo-bar`
entries = sorted(entries, key = lambda e: tuple(e.venv_path.split("/")))

groups = []
current_group = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ _tests.append(_test_conflict_merging)
def _test_conflict_merging_impl(env, _):
entries = [
_entry("a", "+pypi_a/site-packages/a", ["a.txt"]),
_entry("a-1.0.dist-info", "+pypi_a/site-packages/a-1.0.dist-info", ["METADATA"]),
_entry("a/b", "+pypi_a_b/site-packages/a/b", ["b.txt"]),
_entry("x", "_main/src/x", ["x.txt"]),
_entry("x/p", "_main/src-dev/x/p", ["p.txt"]),
Expand All @@ -74,6 +75,7 @@ def _test_conflict_merging_impl(env, _):
expected_libs = {
"a/a.txt": _file("../+pypi_a/site-packages/a/a.txt"),
"a/b/b.txt": _file("../+pypi_a_b/site-packages/a/b/b.txt"),
"a-1.0.dist-info": "+pypi_a/site-packages/a-1.0.dist-info",
"duplicate/d.py": _file("../+dupe_a/site-packages/duplicate/d.py"),
"x/p/p.txt": _file("src-dev/x/p/p.txt"),
"x/x.txt": _file("src/x/x.txt"),
Expand Down