Skip to content

Conversation

rickeylev
Copy link
Collaborator

This documents the //python/config_settings:is_python_* config settings. It adds a disclaimer
that the available targets may vary depending on the root module settings, and tells users
how to match versions when one isn't available.

@rickeylev rickeylev requested a review from aignas as a code owner October 23, 2024 21:31
@rickeylev rickeylev enabled auto-merge October 23, 2024 21:33
Comment on lines 46 to 48
If you need to match a version that isn't present, you can manually define
a `config_setting` and have it match `python_version` or
`python_version_major_minor`.
Copy link
Collaborator

Choose a reason for hiding this comment

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

New versions can be added via python.single_override, so it would be best to do that instead and then the config setting values will be updated. I think we should call out that for bzlmod this is only needed if users are configuring/registering their own toolchains.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I updated the text to mention both options. The main case I have in mind is for non-root modules: they may want to define their own to insulate themselves from what a root module might do. The other main case is for unreleased versions or, yes, customized toolchains.

@aignas
Copy link
Collaborator

aignas commented Oct 26, 2024

Not sure if this is still needed given #2350.

Copy link
Collaborator Author

@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.

Yeah, that PR will take care of most of the problem.

I think the doc is still necessary, though, since (1) the root module can cause targets to disappear, (2) we know people customize TOOL_VERSIONS, and (3) eventually we'll drop some of the very old python versions in our own versions file (or otherwise make them more of an opt-in type of thing).

Comment on lines 46 to 48
If you need to match a version that isn't present, you can manually define
a `config_setting` and have it match `python_version` or
`python_version_major_minor`.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I updated the text to mention both options. The main case I have in mind is for non-root modules: they may want to define their own to insulate themselves from what a root module might do. The other main case is for unreleased versions or, yes, customized toolchains.

@rickeylev rickeylev added this pull request to the merge queue Oct 27, 2024
Merged via the queue into bazel-contrib:main with commit 2f04951 Oct 27, 2024
4 checks passed
@rickeylev rickeylev deleted the doc.is.python.config.settings branch October 29, 2024 03:33
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