Skip to content

Commit da6ba5e

Browse files
authored
Merge branch 'main' into fix.conflict.merging.files
2 parents d00109d + 0816a1f commit da6ba5e

11 files changed

Lines changed: 465 additions & 264 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 = [

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/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)

python/private/pypi/requirements_files_by_platform.bzl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,8 @@ def requirements_files_by_platform(
144144

145145
input_platforms = platforms
146146
default_platforms = [_platform(p, python_version) for p in platforms]
147+
if logger:
148+
logger.debug(lambda: "Input platforms: {}".format(input_platforms))
147149

148150
if platforms_from_args:
149151
lock_files = [

python/private/pypi/whl_library.bzl

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -377,10 +377,7 @@ def _whl_library_impl(rctx):
377377
#
378378
# Remove non-pipstar and config_load check when we release rules_python 2.
379379
if enable_pipstar:
380-
# Extracting .whl files requires Bazel 8.3.0 or later, so require a
381-
# minimum of Bazel 9.0.0 to ensure compatibilty with earlier versions
382-
# of Bazel 8.
383-
if rp_config.bazel_9_or_later:
380+
if rp_config.supports_whl_extraction:
384381
extract_path = whl_path
385382
else:
386383
extract_path = rctx.path(whl_path.basename + ".zip")
@@ -389,7 +386,7 @@ def _whl_library_impl(rctx):
389386
archive = extract_path,
390387
output = "site-packages",
391388
)
392-
if not rp_config.bazel_9_or_later:
389+
if not rp_config.supports_whl_extraction:
393390
rctx.delete(extract_path)
394391

395392
metadata = whl_metadata(

0 commit comments

Comments
 (0)