Feat: Python version support for pycross_wheel_builder#178
Feat: Python version support for pycross_wheel_builder#178LaurenceTews wants to merge 2 commits intojvolkman:mainfrom
Conversation
|
This seems pretty useful. I put together a demo one time, but only setting flags via the CLI: https://github.com/jvolkman/bazel-pycross-zstandard-example I wonder though whether there's a more composable way to accomplish this? Have you looked at something like https://github.com/fmeum/with_cfg.bzl? I think that should allow creating different version-specific
I guess this means this won't support cross-platform builds? What's preventing support for the pycross toolchain? |
|
@jvolkman thanks for your response. with_cfg looks really interesting, it seems like a great option for modifying rules from external repos. In terms of using it inside of rules_pycross, it does create a slightly awkward invocation pattern, since it has to be called from a .bzl file. It would look something like this - Regarding the pycross toolchain, the transition does in fact work for that toolchain type. I didn't realise it uses the same config setting as rules_python. So that's definitely a win. |
Context
My team is looking to build wheels with multiple version of Python. We've been using the transition in this PR to add python_version support to the pycross_wheel_build rule. It uses the rules_python flag so that Bazel resolves the correct toolchain for the corresponding python_version. This only works for toolchains of type
@rules_python//python:toolchain_typeand not//pycross:toolchain_type.Happy to add some tests and update the docs for this if it's something folks would be interested in.