Skip to content

Commit 1a38423

Browse files
committed
Refactor import path generation
1 parent 3faa93f commit 1a38423

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

dev/check_python.bzl

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,14 @@ def check_python(
6161
args = ctx.actions.args()
6262
args.add(output_file, format = "--out=%s")
6363
args.add(params_file, format = "--params=%s")
64+
roots = ["", ctx.bin_dir.path]
6465
args.add_all(
6566
info.imports,
66-
format_each = "--import=external/%s",
67-
uniquify = True,
68-
expand_directories = False,
69-
)
70-
args.add_all(
71-
info.imports,
72-
format_each = "--import=" + ctx.bin_dir.path + "/external/%s",
67+
map_each = lambda i: [paths.join(r, "external", i) for r in roots],
68+
format_each = "--import=%s",
7369
uniquify = True,
7470
expand_directories = False,
71+
allow_closure = True,
7572
)
7673
args.add_all(
7774
info.transitive_sources,

0 commit comments

Comments
 (0)