Skip to content

Commit c6357a6

Browse files
authored
Fixed incorrect custom compile commands from compile_pip_requirements (#627)
1 parent 83f9154 commit c6357a6

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

python/pip_install/pip_compile.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
requirements_in = os.path.relpath(sys.argv.pop(1))
1717
requirements_txt = sys.argv.pop(1)
18-
update_target_name = sys.argv.pop(1)
18+
update_target_label = sys.argv.pop(1)
1919

2020
# Before loading click, set the locale for its parser.
2121
# If it leaks through to the system setting, it may fail:
@@ -65,9 +65,8 @@
6565
# $(rootpath) in the workspace root gives ./requirements.in
6666
if update_target_pkg == ".":
6767
update_target_pkg = ""
68-
update_command = os.getenv("CUSTOM_COMPILE_COMMAND") or "bazel run //%s:%s" % (
69-
update_target_pkg,
70-
update_target_name,
68+
update_command = os.getenv("CUSTOM_COMPILE_COMMAND") or "bazel run %s" % (
69+
update_target_label,
7170
)
7271

7372
os.environ["CUSTOM_COMPILE_COMMAND"] = update_command

python/pip_install/requirements.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def compile_pip_requirements(
5454
args = [
5555
loc % requirements_in,
5656
loc % requirements_txt,
57-
name + ".update",
57+
"//%s:%s.update" % (native.package_name(), name),
5858
] + extra_args
5959

6060
deps = [

0 commit comments

Comments
 (0)