Is it possible to specify the bazel "--build_python_zip" flag from within the py_binary rule so that I don't need to add this flag every time I use Bazel in my workspace?
After PR 9453, you can:
filegroup(
name = "foo_zip",
srcs = [":foo_binary"],
output_group = "python_zip_file",
)
py_binary(
name = "foo_binary",
srcs = ["foo.py"],
)
Then you can invoke bazel as:
bazel build :foo_zip
and don't have to specify --build_python_zip. This will also allow par_binary rules to co-exist with native zips.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With