Open py-version range + harness gate for py3.14 backends (#379)
Prep for a future sub-interpreter (PEP 734
`concurrent.interpreters`) spawn backend per issue
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 d318f1f8f4)
(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)
trionics_start_or_cancel
parent
eb3e2b3574
commit
54a694d452
|
|
@ -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:
|
||||
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
|
||||
|
|
|
|||
Loading…
Reference in New Issue