Skip to content

Commit e9688b7

Browse files
authored
Merge branch 'main' into main
2 parents 7b52502 + 4558ffb commit e9688b7

20 files changed

Lines changed: 886 additions & 456 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ END_UNRELEASED_TEMPLATE
108108
{#v0-0-0-added}
109109
### Added
110110
* (toolchains) `3.9.25` Python toolchain from [20251031] release.
111+
* (toolchains) `3.13.10`, `3.14.1` Python toolchain from [20251202] release.
112+
* (toolchains) `3.13.11`, `3.14.2`, `3.15.0a2` Python toolchains from [20251209] release.
111113
* (pypi) API to tell `pip.parse` which platforms users care about. This is very useful to ensure
112114
that when users do `bazel query` for their deps, they don't have to download all of the
113115
dependencies for all of the available wheels. Torch wheels can be up of 1GB and it takes a lot
@@ -118,6 +120,9 @@ END_UNRELEASED_TEMPLATE
118120
become mandatory if any cross-builds are required from the next release.
119121

120122
[20251031]: https://github.com/astral-sh/python-build-standalone/releases/tag/20251031
123+
[20251202]: https://github.com/astral-sh/python-build-standalone/releases/tag/20251202
124+
[20251209]: https://github.com/astral-sh/python-build-standalone/releases/tag/20251209
125+
121126
{#v1-7-0}
122127
## [1.7.0] - 2025-10-11
123128

MODULE.bazel

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,11 @@ dev_pip = use_extension(
305305
parallel_download = False,
306306
python_version = python_version,
307307
requirements_lock = "//docs:requirements.txt",
308+
# Ensure that we are setting up the following platforms
309+
target_platforms = [
310+
"{os}_{arch}",
311+
"{os}_{arch}_freethreaded",
312+
],
308313
)
309314
for python_version in [
310315
"3.9",

docs/BUILD.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,8 @@ sphinx_build_binary(
165165
config_settings = {
166166
labels.BOOTSTRAP_IMPL: "script",
167167
labels.VENVS_SITE_PACKAGES: "yes",
168+
labels.PY_FREETHREADED: "yes",
169+
labels.PYTHON_VERSION: "3.14",
168170
},
169171
target_compatible_with = _TARGET_COMPATIBLE_WITH,
170172
deps = [

examples/wheel/private/wheel_utils.bzl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ def _directory_writer_impl(ctx):
2828

2929
ctx.actions.run(
3030
outputs = [output],
31+
mnemonic = "PyDirWriter",
3132
arguments = [args],
3233
executable = ctx.executable._writer,
3334
)

gazelle/manifest/defs.bzl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ def _sources_hash_impl(ctx):
184184
args.add_all(all_srcs)
185185
ctx.actions.run(
186186
outputs = [hash_file],
187+
mnemonic = "PyGazelleManifestHash",
187188
inputs = all_srcs,
188189
arguments = [args],
189190
executable = ctx.executable._hasher,

gazelle/modules_mapping/def.bzl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ def _modules_mapping_impl(ctx):
4343

4444
ctx.actions.run(
4545
inputs = [whl],
46+
mnemonic = "PyGazelleModMapGen",
4647
outputs = [wheel_modules_mapping],
4748
executable = ctx.executable._generator,
4849
arguments = [args],
@@ -57,6 +58,7 @@ def _modules_mapping_impl(ctx):
5758

5859
ctx.actions.run(
5960
inputs = per_wheel_outputs,
61+
mnemonic = "PyGazelleModMapMerge",
6062
outputs = [modules_mapping],
6163
executable = ctx.executable._merger,
6264
arguments = [merge_args],

python/private/internal_config_repo.bzl

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ _ENABLE_DEPRECATION_WARNINGS_DEFAULT = "0"
2929
_CONFIG_TEMPLATE = """
3030
config = struct(
3131
build_python_zip_default = {build_python_zip_default},
32+
supports_whl_extraction = {supports_whl_extraction},
3233
enable_pystar = True,
3334
enable_pipstar = {enable_pipstar},
3435
enable_deprecation_warnings = {enable_deprecation_warnings},
@@ -91,8 +92,20 @@ _TRANSITION_SETTINGS_DEBUG_TEMPLATE = """
9192
def _internal_config_repo_impl(rctx):
9293
# An empty version signifies a development build, which is treated as
9394
# the latest version.
94-
bazel_major_version = int(native.bazel_version.split(".")[0]) if native.bazel_version else 99999
95+
if native.bazel_version:
96+
version_parts = native.bazel_version.split(".")
97+
bazel_major_version = int(version_parts[0])
98+
bazel_minor_version = int(version_parts[1])
99+
else:
100+
bazel_major_version = 99999
101+
bazel_minor_version = 99999
102+
103+
supports_whl_extraction = False
95104
if bazel_major_version >= 8:
105+
# Extracting .whl files requires Bazel 8.3.0 or later.
106+
if bazel_major_version > 8 or bazel_minor_version >= 3:
107+
supports_whl_extraction = True
108+
96109
builtin_py_info_symbol = "None"
97110
builtin_py_runtime_info_symbol = "None"
98111
builtin_py_cc_link_params_provider = "None"
@@ -107,6 +120,7 @@ def _internal_config_repo_impl(rctx):
107120
enable_deprecation_warnings = _bool_from_environ(rctx, _ENABLE_DEPRECATION_WARNINGS_ENVVAR_NAME, _ENABLE_DEPRECATION_WARNINGS_DEFAULT),
108121
builtin_py_info_symbol = builtin_py_info_symbol,
109122
builtin_py_runtime_info_symbol = builtin_py_runtime_info_symbol,
123+
supports_whl_extraction = str(supports_whl_extraction),
110124
builtin_py_cc_link_params_provider = builtin_py_cc_link_params_provider,
111125
bazel_8_or_later = str(bazel_major_version >= 8),
112126
bazel_9_or_later = str(bazel_major_version >= 9),

python/private/pypi/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ bzl_library(
247247
deps = [
248248
":parse_whl_name_bzl",
249249
"//python/private:repo_utils_bzl",
250+
"@rules_python_internal//:rules_python_config_bzl",
250251
],
251252
)
252253

python/private/pypi/extension.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,7 @@ EXPERIMENTAL: this may be removed without notice.
665665
""",
666666
),
667667
"target_platforms": attr.string_list(
668-
default = ["{os}_{arch}"],
668+
default = [],
669669
doc = """\
670670
The list of platforms for which we would evaluate the requirements files. If you need to be able to
671671
only evaluate for a particular platform (e.g. "linux_x86_64"), then put it in here.

python/private/pypi/hub_builder.bzl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,10 @@ def _pip_parse(self, module_ctx, pip_attr):
141141
module_ctx,
142142
python_version = full_python_version,
143143
config = self._config,
144-
# FIXME @aignas 2025-12-06: should we have this behaviour?
145-
# TODO @aignas 2025-12-06: use target_platforms always even when the get_index_urls is set.
146-
target_platforms = [] if default_cross_setup else pip_attr.target_platforms,
144+
# TODO @aignas 2025-12-09: flip or part to default to 'os_arch' after
145+
# VERSION_NEXT_FEATURE is released and set the default of the `target_platforms` attribute
146+
# to `{os}_{arch}`.
147+
target_platforms = pip_attr.target_platforms or ([] if default_cross_setup else ["{os}_{arch}"]),
147148
)
148149
_add_group_map(self, pip_attr.experimental_requirement_cycles)
149150
_add_extra_aliases(self, pip_attr.extra_hub_aliases)

0 commit comments

Comments
 (0)