Skip to content

Commit 50ffd3e

Browse files
authored
Declare a Python 3.13 toolchain, revert setup.py toolchain arget selection (#1876)
The new solution was too smart (read: dense), because it did not account for the fact that we look for the Windows libs of the interpreter building the wheel, not the hermetic one supplying the header files. The fix is to just align the versions again, so that the libs and headers come from the same minor version.
1 parent a6af6ee commit 50ffd3e

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

MODULE.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ python.toolchain(
2727
is_default = True,
2828
python_version = "3.12",
2929
)
30+
python.toolchain(python_version = "3.13")
3031

3132
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip", dev_dependency = True)
3233
pip.parse(

setup.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -92,16 +92,10 @@ def copy_extensions_to_source(self):
9292
def bazel_build(self, ext: BazelExtension) -> None:
9393
"""Runs the bazel build to create the package."""
9494
temp_path = Path(self.build_temp)
95-
if py_limited_api:
96-
# We only need to know the minimum ABI version,
97-
# since it is stable across minor versions by definition.
98-
# The value here is calculated as the minimum of a) the minimum
99-
# Python version required, and b) the stable ABI version target.
100-
# NB: This needs to be kept in sync with [project.requires-python]
101-
# in pyproject.toml.
102-
python_version = "3.12"
103-
else:
104-
python_version = "{0}.{1}".format(*sys.version_info[:2])
95+
96+
# We round to the minor version, which makes rules_python
97+
# look up the latest available patch version internally.
98+
python_version = "{0}.{1}".format(*sys.version_info[:2])
10599

106100
bazel_argv = [
107101
"bazel",

0 commit comments

Comments
 (0)