Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

forward extra kwargs from py_venv to its internal targets #4

Merged
merged 1 commit into from
Nov 29, 2022
Merged
Changes from all commits
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
6 changes: 4 additions & 2 deletions venv.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ _py_venv_deps = rule(
toolchains = [PYTHON_TOOLCHAIN_TYPE],
)

def py_venv(name, deps = None, extra_pip_commands = None):
def py_venv(name, deps = None, extra_pip_commands = None, **kwargs):
deps = deps or []
extra_pip_commands = extra_pip_commands or []

Expand All @@ -71,15 +71,17 @@ def py_venv(name, deps = None, extra_pip_commands = None):
deps = deps,
commands = extra_pip_commands,
output = out_name,
**kwargs,
)

py_binary(
name = name,
srcs = ["@rules_pyvenv//:build_env.py"],
deps = ["@rules_pyvenv//vendor/importlib_metadata"],
deps = ["@rules_pyvenv//vendor/importlib_metadata"],
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also fixed a line with some weird whitespace 🙂

data = [out_label] + deps,
main = "@rules_pyvenv//:build_env.py",
env = {
"BUILD_ENV_INPUT": "$(location " + out_label + ")",
},
**kwargs,
)