Skip to content

Commit 2783415

Browse files
committed
wip
1 parent b8df975 commit 2783415

File tree

4 files changed

+7
-34
lines changed

4 files changed

+7
-34
lines changed

CHANGELOG.md

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -78,16 +78,7 @@ A brief description of the categories of changes:
7878
### Removed
7979
* (toolchains): Removed accidentally exposed `http_archive` symbol from
8080
`python/repositories.bzl`.
81-
* (toolchains): An internal _is_python_config_setting_ has been removed
82-
from rules_python as it can now be replaced by:
83-
```starlark
84-
native.config_setting(
85-
name = "my_config_setting",
86-
flag_values = {
87-
"@rules_python//python/config_settings:python_version_major_minor": "3.11",
88-
},
89-
)
90-
```
81+
* (toolchains): An internal _is_python_config_setting_ macro has been removed.
9182

9283
## [0.35.0] - 2024-08-15
9384

MODULE.bazel

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,6 @@ python.toolchain(
4646
is_default = True,
4747
python_version = "3.11",
4848
)
49-
python.toolchain(
50-
python_version = "3.12",
51-
)
5249
use_repo(python, "python_3_11", "python_versions", "pythons_hub")
5350

5451
# This call registers the Python toolchains.
@@ -98,11 +95,6 @@ dev_pip.parse(
9895
python_version = "3.11",
9996
requirements_lock = "//docs:requirements.txt",
10097
)
101-
dev_pip.parse(
102-
hub_name = "dev_pip",
103-
python_version = "3.12",
104-
requirements_lock = "//docs:requirements.txt",
105-
)
10698
dev_pip.parse(
10799
hub_name = "pypiserver",
108100
python_version = "3.11",

examples/bzlmod/MODULE.bazel.lock

Lines changed: 2 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

python/private/config_settings.bzl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ load("@bazel_skylib//rules:common_settings.bzl", "BuildSettingInfo")
2020
load("//python:versions.bzl", "MINOR_MAPPING", "TOOL_VERSIONS")
2121
load(":semver.bzl", "semver")
2222

23-
_PYTHON_VERSION_FLAG = str(Label("//python/config_settings:python_version"))
24-
_PYTHON_MINOR_VERSION_FLAG = str(Label("//python/config_settings:python_version_major_minor"))
23+
_PYTHON_VERSION_FLAG = Label("//python/config_settings:python_version")
24+
_PYTHON_MAJOR_MINOR_VERSION_FLAG = Label("//python/config_settings:_python_major_minor_version")
2525

2626
def construct_config_settings(name = None): # buildifier: disable=function-docstring
2727
"""Create a 'python_version' config flag and construct all config settings used in rules_python.
@@ -43,7 +43,7 @@ def construct_config_settings(name = None): # buildifier: disable=function-docs
4343
)
4444

4545
_python_major_minor(
46-
name = "python_version_major_minor",
46+
name = _PYTHON_MAJOR_MINOR_VERSION_FLAG.name,
4747
build_setting_default = "",
4848
visibility = ["//visibility:public"],
4949
)
@@ -61,7 +61,7 @@ def construct_config_settings(name = None): # buildifier: disable=function-docs
6161
for minor in range(20):
6262
native.config_setting(
6363
name = "is_python_3.{}".format(minor),
64-
flag_values = {_PYTHON_MINOR_VERSION_FLAG: "3.{}".format(minor)},
64+
flag_values = {_PYTHON_MAJOR_MINOR_VERSION_FLAG: "3.{}".format(minor)},
6565
visibility = ["//visibility:public"],
6666
)
6767

0 commit comments

Comments
 (0)