Skip to content

Commit 4f4e5fb

Browse files
committed
implement the sorting of targets manually
1 parent 7ec284b commit 4f4e5fb

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

python/private/common.bzl

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,18 @@ def _third_party_first(targets):
379379
This is because the DAG is going from first-party deps to third-party deps and usually
380380
no third-party deps include first-party deps.
381381
"""
382-
return sorted(targets, lambda x: PyInfo in x and not x[PyInfo].package)
382+
383+
# this ensures that within the 2 groups of packages the order is maintained
384+
pypi_targets = []
385+
nonpypi_targets = []
386+
387+
for target in targets:
388+
if PyInfo in target and target[PyInfo].package:
389+
pypi_targets.append(target)
390+
else:
391+
nonpypi_targets.append(target)
392+
393+
return pypi_targets + nonpypi_targets
383394

384395
def create_py_info(
385396
ctx,

0 commit comments

Comments
 (0)