Skip to content
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
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,20 @@ Built-in rules for creating optimized container images:
bazel_dep(name = "aspect_rules_py", version = "1.11.2")
```

### Requirements

The minimum supported Python version is **3.10**. The launcher, test runners, and build
tools that run under your configured interpreter use 3.10 syntax, and CI only exercises
3.10 and newer. Older interpreters can still be fetched via `interpreters.configure()`,
but `py_binary` and `py_test` targets will fail at startup on them.
Comment on lines +144 to +145

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid claiming all older-version targets fail at startup

With a fetched pre-3.10 interpreter and a compatible user entry point, generic py_binary and py_test targets do not load the 3.10-only test runners: py/private/py_venv/py_venv_exec.bzl constructs a native launcher that directly executes the venv interpreter with the user's main (lines 94-118). Such targets can therefore start successfully; the syntax restriction applies to specific maintained helpers such as the pytest/unittest runners and build tools. Describe older interpreters as unsupported, or scope the startup-failure statement to targets that actually execute those helpers.

Useful? React with 👍 / 👎.


Some `uv` features need newer versions:

| Feature | Python |
| ----------------------------------------------------------------------------------------------------------------------- | ------ |
| Free-threaded interpreters (`freethreaded = True`), [first shipped in CPython 3.13](https://peps.python.org/pep-0703/) | 3.13+ |
| `pyproject.toml` parsing in sdist native-dependency detection (needs stdlib `tomllib`) | 3.11+ |

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's possibly we'll want to change this to allow 3.10 but lets just stick with it and document it for now.


### Quick Start

Load rules from `aspect_rules_py` in your `BUILD` files:
Expand Down
8 changes: 5 additions & 3 deletions docs/interpreter.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ are discovered automatically from PBS release artifacts and cached in your
it — no repinning, no manifest regeneration.

**No editorial decisions.** We don't decide which Python versions you can use.
Any version published in a PBS release is available. Need Python 3.8? Add an
older release date that includes it.
Any version published in a PBS release is available. Need a version that newer
releases dropped? Add an older release date that includes it. Note that the
rules themselves require Python 3.10 or newer at runtime (see
[Requirements](../README.md#requirements)).

**Windows and cross-platform support.** 9 platforms are registered out of the
box, including Windows (x86_64, aarch64, i686), Linux (glibc and musl), and
Expand Down Expand Up @@ -65,7 +67,7 @@ interpreters.configure(
)

interpreters.toolchain(python_version = "3.12")
interpreters.toolchain(python_version = "3.8") # Resolved from 20241002
interpreters.toolchain(python_version = "3.10") # Resolved from 20241002 once newer releases drop it

use_repo(interpreters, "python_interpreters")
register_toolchains("@python_interpreters//:all")
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ dev-dependencies = [
]

[tool.ruff]
target-version = "py39"
target-version = "py310"
extend-exclude = [
# Intentionally unparsable .py-as-data fixture.
"py/tests/py-venv-multi-exec/broken_data.py",
Expand Down
Loading