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

feat(bzlmod): add python.override APIs #2222

Merged
merged 11 commits into from
Sep 22, 2024

Conversation

aignas
Copy link
Collaborator

@aignas aignas commented Sep 15, 2024

Before this PR the users could not override how the hermetic toolchain
is downloaded when in bzlmod. However, the same APIs would be
available to users using WORKSPACE. With this we also allow root
modules to restrict which toolchain versions the non-root modules, which
may be helpful when optimizing the CI runtimes so that we don't waste
time downloading multiple micro versions of the same 3.X python
version, which most of the times have identical behavior.

Whilst at it, tweak the semver implementation to allow for testing of
absence of values in the original input.

Work towards #2081 and this should be one of the last items that are
blocking #1361 from the API point of view.

Replaces #2151.

@aignas aignas marked this pull request as draft September 15, 2024 06:41
Before this PR the users could not override how the hermetic toolchain
is downloaded when in `bzlmod`. However, the same APIs would be
available to users using `WORKSPACE`. With this we also allow root
modules to restrict which toolchain versions the non-root modules, which
may be helpful when optimizing the CI runtimes so that we don't waste
time downloading multiple `micro` versions of the same `3.X` python
version, which most of the times have identical behavior.

Whilst at it, tweak the `semver` implementation to allow for testing of
absence of values in the original input.

Work towards bazelbuild#2081 and this should be one of the last items that are
blocking bazelbuild#1361 from the API point of view.
@aignas aignas marked this pull request as ready for review September 19, 2024 02:46
Copy link
Contributor

@rickeylev rickeylev left a comment

Choose a reason for hiding this comment

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

Reviewed everything but the python.bzl part and its tests. Just some doc fixes thus far.

docs/toolchains.md Outdated Show resolved Hide resolved
docs/toolchains.md Outdated Show resolved Hide resolved
docs/toolchains.md Outdated Show resolved Hide resolved
examples/bzlmod/MODULE.bazel Outdated Show resolved Hide resolved
examples/bzlmod/MODULE.bazel Outdated Show resolved Hide resolved
python/extensions/python.bzl Outdated Show resolved Hide resolved
python/private/python_repository.bzl Show resolved Hide resolved
python/private/python.bzl Outdated Show resolved Hide resolved
python/private/python.bzl Outdated Show resolved Hide resolved
python/extensions/python.bzl Outdated Show resolved Hide resolved
@aignas aignas added this pull request to the merge queue Sep 22, 2024
Merged via the queue into bazelbuild:main with commit b92927d Sep 22, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants