From d905c08f827142862322695e15a703f680927daf Mon Sep 17 00:00:00 2001 From: goodboy Date: Tue, 9 Jun 2026 20:15:31 -0400 Subject: [PATCH] Open py-version range + harness gate for py3.14 backends (#379) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Prep for a future sub-interpreter (PEP 734 `concurrent.interpreters`) spawn backend per issue #379 — land just the py-version range bump and the test-harness error-gating; the backend itself comes later. Deats, - bump `pyproject.toml` `requires-python` to `>=3.12, <3.15` and list the `3.14` classifier — the new stdlib `concurrent.interpreters` module only ships on 3.14 - `_testing.pytest.pytest_configure` wraps `try_set_start_method()` in a `pytest.UsageError` handler so an unsupported `--spawn-backend` on the running py-version prints a clean banner instead of a traceback (this patch was generated in some part by [`claude-code`][claude-code-gh]) [claude-code-gh]: https://github.com/anthropics/claude-code (cherry picked from commit d318f1f8f4f6a056a8ca67d7f15e4e2a72507ea3) (factored: kept only the pyproject + `_testing/pytest.py` parts of "Add `'subint'` spawn backend scaffold (#379)"; dropped tractor/spawn/_spawn.py + tractor/spawn/_subint.py) --- pyproject.toml | 3 ++- tractor/_testing/pytest.py | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 4bc78323..ef842845 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ name = "tractor" version = "0.1.0a6dev0" description = 'structured concurrent `trio`-"actors"' authors = [{ name = "Tyler Goodlet", email = "goodboy_foss@protonmail.com" }] -requires-python = ">=3.12, <3.14" +requires-python = ">=3.12, <3.15" readme = "docs/README.rst" license = "AGPL-3.0-or-later" keywords = [ @@ -31,6 +31,7 @@ classifiers = [ "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", "Topic :: System :: Distributed Computing", ] dependencies = [ diff --git a/tractor/_testing/pytest.py b/tractor/_testing/pytest.py index 1d803c9e..c33406ff 100644 --- a/tractor/_testing/pytest.py +++ b/tractor/_testing/pytest.py @@ -227,7 +227,13 @@ def pytest_addoption( def pytest_configure(config): backend = config.option.spawn_backend from tractor.spawn._spawn import try_set_start_method - try_set_start_method(backend) + try: + try_set_start_method(backend) + except RuntimeError as err: + # e.g. `--spawn-backend=subint` on Python < 3.14 — turn the + # runtime gate error into a clean pytest usage error so the + # suite exits with a helpful banner instead of a traceback. + raise pytest.UsageError(str(err)) from err # register custom marks to avoid warnings see, # https://docs.pytest.org/en/stable/how-to/writing_plugins.html#registering-custom-markers