Skip to content

Commit 77ecbd1

Browse files
committed
docs: document the is_python config settings
1 parent 6babe59 commit 77ecbd1

File tree

1 file changed

+15
-0
lines changed
  • docs/api/rules_python/python/config_settings

1 file changed

+15
-0
lines changed

docs/api/rules_python/python/config_settings/index.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,21 @@ one of the values that `rules_python` maintains.
3333
Parses the value of the `python_version` and transforms it into a `X.Y` value.
3434
:::
3535

36+
:::{bzl:target} is_python_*
37+
config_settings to match Python versions
38+
39+
The name pattern is `is_python_X.Y` (to match major.minor) and `is_python_X.Y.Z`
40+
(to match major.minor.patch).
41+
42+
Note that the set of available versions depends on the configured `TOOL_VERSIONS`.
43+
Versions may not always be available if the root module has customized them, or
44+
as older Python versions are removed from rules_python's set of known versions.
45+
46+
If you need to match a version that isn't present, you can manually define
47+
a `config_setting` and have it match `python_version` or
48+
`python_version_major_minor`.
49+
:::
50+
3651
::::{bzl:flag} exec_tools_toolchain
3752
Determines if the {obj}`exec_tools_toolchain_type` toolchain is enabled.
3853

0 commit comments

Comments
 (0)