8000 fix defaulted macro args behaviour so users can actually set their va… · bazel-contrib/rules_python@ef4d735 · GitHub
[go: up one dir, main page]

Skip to content

Commit ef4d735

Browse files
author
8000
Jonathon Belotti
authored
fix defaulted macro args behaviour so users can actually set their values (#467)
1 parent 1dc8ed9 commit ef4d735

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

python/pip_install/requirements.bzl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ def compile_pip_requirements(
77
name,
88
extra_args = [],
99
visibility = ["//visibility:private"],
10-
requirements_in = "requirements.in",
11-
requirements_txt = "requirements.txt",
10+
requirements_in = None,
11+
requirements_txt = None,
1212
**kwargs):
1313
"""
1414
Macro creating targets for running pip-compile
@@ -30,8 +30,8 @@ def compile_pip_requirements(
3030
requirements_txt: result of "compiling" the requirements.in file
3131
**kwargs: other bazel attributes passed to the "_test" rule
3232
"""
33-
requirements_in = kwargs.pop("requirements_in", name + ".in")
34-
requirements_txt = kwargs.pop("requirements_locked", name + ".txt")
33+
requirements_in = name + ".in" if requirements_in == None else requirements_in
34+
requirements_txt = name + ".txt" if requirements_txt == None else requirements_txt
3535

3636
# "Default" target produced by this macro
3737
# Allow a compile_pip_requirements rule to include another one in the data

0 commit comments

Comments
 (0)
0