Require Python 3.14 - #9
Conversation
- requires-python = ">=3.14"; CI runs on 3.14 only (3.12/3.13 dropped). - ruff target-version = py314, mypy python_version = 3.14. - ruff auto-applies two py314 idioms: unparenthesised `except` (PEP 758) in __main__.py, and an unquoted self-referential return annotation in eval_board.py (safe under PEP 649 lazy annotations). - Sync .pre-commit-config.yaml hook revs to the current pyproject dev pins (ruff 0.16.4, mypy 2.3.1, chess 1.11.2, pytest 9.1.1). - Docs, badge, and changelog updated. Verified on 3.14.7: ruff, ruff format, mypy (strict), pytest (80 pass, 91% coverage), pre-commit, and a UCI end-to-end run. On Linux, 3.14 defaults multiprocessing to forkserver; the Lazy SMP worker is already spawn-compatible. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
🟢 Approval recommended
The changes consistently apply the Python 3.14 baseline across packaging, CI, and docs without introducing any verified functional or typing issues in the modified code paths.
Pull request overview
This PR updates pychess to require Python 3.14+ across packaging metadata, CI, and contributor-facing documentation, and aligns formatting/linting/type-check tooling to the same baseline.
Changes:
- Raise the project’s minimum supported Python to 3.14 (
requires-python, classifiers, ruff target version, mypypython_version). - Update CI to run lint/type-check/test only on Python 3.14.
- Sync docs and pre-commit hook versions with the new tooling pins, and apply a couple of 3.14-only syntax/typing idioms.
File summaries
| File | Description |
|---|---|
| src/pychess/eval_board.py | Uses 3.14+ annotation behavior to drop a quoted forward reference in EvalBoard.copy()’s return type. |
| src/pychess/main.py | Adopts 3.14+ except syntax for multiple exception types (no parentheses). |
| README.md | Updates Python support badge and “Requires Python …” wording to 3.14+. |
| pyproject.toml | Enforces Python 3.14 minimum and retargets ruff/mypy configuration accordingly. |
| CONTRIBUTING.md | Updates venv setup instructions to use python3.14. |
| CLAUDE.md | Updates the agent guide to reflect Python 3.14+ and CI running on 3.14. |
| CHANGELOG.md | Notes the new Python 3.14 requirement under Unreleased changes. |
| .pre-commit-config.yaml | Bumps pre-commit hook revs / deps to match pyproject.toml pins. |
| .github/workflows/ci.yml | Updates lint job and test matrix to run only on Python 3.14. |
Review details
- Files reviewed: 9/9 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Summary
Bumps the project to Python 3.14 only.
requires-python = ">=3.14"; classifiers,ruff target-version = py314,mypy python_version = 3.14ci.yml) lint job and test matrix both run on 3.14 (3.12 / 3.13 dropped)ruff-applied py314 idioms
Retargeting ruff to
py314auto-fixed two spots (both valid 3.14+ syntax):src/pychess/__main__.py:except (IndexError, FileNotFoundError, OSError):→
except IndexError, FileNotFoundError, OSError:(PEP 758 — parentheses nolonger required)
src/pychess/eval_board.py:-> "EvalBoard"→-> EvalBoard(safe underPEP 649 deferred annotation evaluation)
Tooling sync
.pre-commit-config.yamlhook revs were stale vspyproject.toml; bumped tomatch (ruff 0.16.4, mypy 2.3.1,
chess1.11.2,pytest9.1.1).Testing
On Python 3.14.7:
ruff check,ruff format --check,mypy(strict),pytest(80 pass, 91% coverage),pre-commit, and a UCI end-to-end search allgreen.
On Linux, 3.14 changes the multiprocessing default from
forktoforkserver.The Lazy SMP worker already assumes spawn-style semantics (pickled payloads,
re-imports, shared memory attached by name), so
forkserveris fine — CI willconfirm on Linux.
Checklist
ruff check .andruff format --check .passmypypasses (strict onsrc/)pytestpasses; coverage stays >= 85%CHANGELOG.mdupdated under## [Unreleased]README.md/docs/*.mdupdated🤖 Generated with Claude Code