Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Declare a Python 3.13 toolchain, revert setup.py toolchain target sele… #1876

Merged
merged 1 commit into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ python.toolchain(
is_default = True,
python_version = "3.12",
)
python.toolchain(python_version = "3.13")

pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip", dev_dependency = True)
pip.parse(
Expand Down
14 changes: 4 additions & 10 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,10 @@ def copy_extensions_to_source(self):
def bazel_build(self, ext: BazelExtension) -> None:
"""Runs the bazel build to create the package."""
temp_path = Path(self.build_temp)
if py_limited_api:
# We only need to know the minimum ABI version,
# since it is stable across minor versions by definition.
# The value here is calculated as the minimum of a) the minimum
# Python version required, and b) the stable ABI version target.
# NB: This needs to be kept in sync with [project.requires-python]
# in pyproject.toml.
python_version = "3.12"
else:
python_version = "{0}.{1}".format(*sys.version_info[:2])

# We round to the minor version, which makes rules_python
# look up the latest available patch version internally.
python_version = "{0}.{1}".format(*sys.version_info[:2])

bazel_argv = [
"bazel",
Expand Down