Skip to content

docs/refactor: Use python.defaults, not is_default #2924

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

Merged
merged 2 commits into from
May 23, 2025

Conversation

vonschultz
Copy link
Contributor

@vonschultz vonschultz commented May 22, 2025

When there are multiple Python toolchains, there are currently two ways of setting the default version: the is_default attribute of the python.toolchain() tag class and the python.defaults() tag class. The latter is more powerful, since it also supports files and environment variables. This patch updates the examples and the docs to use python.defaults().

Relates to pull request #2588 and issue #2587.

When there are multiple Python toolchains, there are currently two
ways of setting the default version: the is_default attribute of
python.toolchain() tag class and the python.defaults() tag class. The
latter is more powerful, since it also supports files and environment
variables. This patch updates the examples, docs and the MODULE.bazel
file to use python.defaults().

Relates to pull request bazel-contrib#2588 and issue bazel-contrib#2587.
Apparently changing the top-level MODULE.bazel can break things, so
that will keep using is_default for now.
Copy link
Collaborator

@aignas aignas left a comment

Choose a reason for hiding this comment

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

Thank you!

@aignas aignas added this pull request to the merge queue May 23, 2025
Merged via the queue into bazel-contrib:main with commit 46f08de May 23, 2025
3 checks passed
@vonschultz vonschultz deleted the python_defaults branch May 23, 2025 14:08
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