-
-
Notifications
You must be signed in to change notification settings - Fork 23
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
[Bug]: --build_python_zip
seems to not work in py_binary
#236
Comments
We had a design discussion about this today, but we don't have enough requirements. I'm not sure that the Bazel implementation for We could start from first-principles and follow https://peps.python.org/pep-0441/ - in this case rules_py could produce a zipapp following that specification that includes only the python files in your application (and the runfiles tree for their We could offer something different - a PEX file is a well-understood "self-extracting executable" for Python. rules_py could produce something identical to https://www.pantsbuild.org/2.20/docs/python/overview/pex and this would be usable in more cases. |
If there is a self executing python file, that would seem like a upgrade and much better then zip.. Others can tell me if I am wrong, but currently, the zip is just the best we got right now, sorta deal. I would much prefer to just execute a file like most other code can do. |
@alexeagle Thanks for the reply. We are using a docker environment so both .pyz and .pex satisfy our use case. I'm not faimliar with Bazel implementation details so please follow your decision. |
### Type of change - New feature or functionality (#236) ### Test plan - New test cases added --------- Co-authored-by: Matt Mackay <matt@aspect.dev>
What happened?
When building a py_binary with
--build_python_zip
specified, expected .zip artifact is not generated.Version
Development (host) and target OS/architectures:
Ubuntu 20.04
Output of
bazel --version
:bazel 7.0.0 (bazelisk)
Version of the Aspect rules, or other relevant rules from your
WORKSPACE
orMODULE.bazel
file:aspect_rules_py, version: 0.5.0
rules_python, version: 0.22.0
Language(s) and/or frameworks involved:
Python
How to reproduce
Running with:
bazel build //:script --build_python_zip
The text was updated successfully, but these errors were encountered: