-
Notifications
You must be signed in to change notification settings - Fork 559
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
refactor(whl_library): move bazel file generation to Starlark #1336
refactor(whl_library): move bazel file generation to Starlark #1336
Conversation
FYI @chrislovecnm, I decided to see how this idea of generating BUILD.bazel and other extra files worked out in reality and I think I am happy with the solution. It makes working on the #1262 and extending the API easier, hence me doing this refactor before extending the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly lgtm
python/pip_install/private/generate_whl_library_build_bazel.bzl
Outdated
Show resolved
Hide resolved
python/pip_install/private/generate_whl_library_build_bazel.bzl
Outdated
Show resolved
Hide resolved
Before this PR, the `wheel_installer` was doing three things: 1. Downloading the right wheel. 2. Extracting it into the output directory. 3. Generating BUILD.bazel files based on the extracted contents. This PR is moving the third part into the `whl_library` repository rule and it has the following benefits: * We can reduce code duplication and label sanitization functions in rules_python. * There are many things that the `wheel_installer` does not care anymore and we don't need to change less code when extending `whl_library` as we can now do many things in starlark directly. * It becomes easier to change the API of how we expose the generated BUILD.bazel patching because we only need to change the Starlark functions. Work towards bazelbuild#1330.
9210aea
to
d6a7707
Compare
Before this PR, the
wheel_installer
was doing three things:This PR is moving the third part into the
whl_library
repository ruleand it has the following benefits:
rules_python.
wheel_installer
does not care anymoreand we don't need to change less code when extending
whl_library
aswe can now do many things in starlark directly.
BUILD.bazel patching because we only need to change the Starlark
functions.
Work towards #1330.