Skip to content
Draft
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
14 changes: 7 additions & 7 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ python = use_extension("//python/extensions:python.bzl", "python")
# NOTE: There must be a corresponding `python.toolchain()` call for the version
# specified here.
python.defaults(
python_version = "3.11",
python_version = "3.14",
)
python.toolchain(
python_version = "3.11",
python_version = "3.14",
)
use_repo(
python,
"python_3_11",
"python_3_14",
"pythons_hub",
python = "python_versions",
)
Expand All @@ -68,7 +68,7 @@ register_toolchains("@pythons_hub//:all")
pip = use_extension("//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "rules_python_publish_deps",
python_version = "3.11",
python_version = "3.14",
requirements_by_platform = {
"//tools/publish:requirements_darwin.txt": "osx_*",
"//tools/publish:requirements_linux.txt": "linux_*",
Expand Down Expand Up @@ -214,17 +214,17 @@ dev_pip = use_extension(
dev_pip.parse(
download_only = True,
hub_name = "pypiserver",
python_version = "3.11",
python_version = "3.14",
requirements_lock = "//examples/wheel:requirements_server.txt",
)
dev_pip.parse(
hub_name = "pypi_alpha",
python_version = "3.11",
python_version = "3.14",
requirements_lock = "//tests/multi_pypi/alpha:requirements.txt",
)
dev_pip.parse(
hub_name = "pypi_beta",
python_version = "3.11",
python_version = "3.14",
requirements_lock = "//tests/multi_pypi/beta:requirements.txt",
)
use_repo(dev_pip, "dev_pip", "pypi", "pypi_alpha", "pypi_beta", "pypiserver")
Expand Down
4 changes: 2 additions & 2 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ py_repositories()

python_register_multi_toolchains(
name = "python",
default_version = "3.11",
default_version = "3.14",
# Integration tests verify each version, so register all of them.
python_versions = PYTHON_VERSIONS,
)
Expand Down Expand Up @@ -112,7 +112,7 @@ load("@rules_python_gazelle_plugin//:deps.bzl", _py_gazelle_deps = "gazelle_deps
_py_gazelle_deps()

# This interpreter is used for various rules_python dev-time tools
interpreter = "@python_3_11_9_host//:python"
interpreter = "@python_3_14_4_host//:python"

#####################
# Install twine for our own runfiles wheel publishing.
Expand Down
8 changes: 4 additions & 4 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ bazel_dep(name = "rules_python", version = "0.0.0")
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pypi",
python_version = "3.11",
python_version = "3.14",
requirements_lock = "//:requirements.txt",
)
use_repo(pip, "pypi")
Expand Down Expand Up @@ -57,17 +57,17 @@ py_repositories()
load("@rules_python//python:repositories.bzl", "python_register_toolchains")

python_register_toolchains(
name = "python_3_11",
name = "python_3_14",
# Available versions are listed in @rules_python//python:versions.bzl.
# We recommend using the same version your team is already standardized on.
python_version = "3.11",
python_version = "3.14",
)

load("@rules_python//python:pip.bzl", "pip_parse")

pip_parse(
name = "pypi",
python_interpreter_target = "@python_3_11_host//:python",
python_interpreter_target = "@python_3_14_host//:python",
requirements_lock = "//:requirements.txt",
)
```
Expand Down
4 changes: 2 additions & 2 deletions docs/toolchains.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,9 @@ folder. Look for the examples that contain a `MODULE.bazel` file.

The `python.toolchain()` call makes its contents available under a repo named
`python_X_Y`, where X and Y are the major and minor versions. For example,
`python.toolchain(python_version="3.11")` creates the repo `@python_3_11`.
`python.toolchain(python_version="3.14")` creates the repo `@python_3_14`.
Remember to call `use_repo()` to make repos visible to your module:
`use_repo(python, "python_3_11")`.
`use_repo(python, "python_3_14")`.


:::{deprecated} 1.1.0
Expand Down
1 change: 1 addition & 0 deletions examples/wheel/requirements_server.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# This is for running publishing tests
pypiserver>=2.2.0
legacy-cgi; python_version >= "3.13"
12 changes: 7 additions & 5 deletions examples/wheel/requirements_server.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
#
# This file is autogenerated by pip-compile with Python 3.11
# This file is autogenerated by pip-compile with Python 3.14
# by the following command:
#
# bazel run //examples/wheel:requirements_server.update
#
importlib-resources==7.1.0 \
--hash=sha256:0722d4c6212489c530f2a145a34c0a7a3b4721bc96a15fada5930e2a0b760708 \
--hash=sha256:1bd7b48b4088eddb2cd16382150bb515af0bd2c70128194392725f82ad2c96a1
# via pypiserver
legacy-cgi==2.6.4 ; python_version >= "3.13" \
--hash=sha256:7e235ce58bf1e25d1fc9b2d299015e4e2cd37305eccafec1e6bac3fc04b878cd \
--hash=sha256:abb9dfc7835772f7c9317977c63253fd22a7484b5c9bbcdca60a29dcce97c577
# via
# -r examples/wheel/requirements_server.in
# pypiserver
packaging==26.1 \
--hash=sha256:5d9c0669c6285e491e0ced2eee587eaf67b670d94a19e94e3984a481aba6802f \
--hash=sha256:f042152b681c4bfac5cae2742a55e103d27ab2ec0f3d88037136b6bfe7c9c5de
Expand Down
6 changes: 3 additions & 3 deletions python/extensions/python.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ The simplest way to configure the toolchain with `rules_python` is as follows.

```starlark
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.defaults(python_version = "3.11")
python.toolchain(python_version = "3.11")
use_repo(python, "python_3_11")
python.defaults(python_version = "3.14")
python.toolchain(python_version = "3.14")
use_repo(python, "python_3_14")
```

:::{seealso}
Expand Down
6 changes: 3 additions & 3 deletions python/private/python.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -1210,10 +1210,10 @@ In order to use a different name than the above, you can use the following `MODU
syntax:
```starlark
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.defaults(python_version = "3.11")
python.toolchain(python_version = "3.11")
python.defaults(python_version = "3.14")
python.toolchain(python_version = "3.14")

use_repo(python, my_python_name = "python_3_11")
use_repo(python, my_python_name = "python_3_14")
```

Then the python interpreter will be available as `my_python_name`.
Expand Down
Loading