Skip to content

Require Python 3.14 - #9

Merged
cjunius merged 1 commit into
mainfrom
chore/python-3.14
Aug 30, 2026
Merged

cjunius merged 1 commit into
mainfrom
chore/python-3.14

Conversation

@cjunius

@cjunius cjunius commented Aug 30, 2026

Copy link
Copy Markdown
Owner

Summary

Bumps the project to Python 3.14 only.

  • requires-python = ">=3.14"; classifiers, ruff target-version = py314,
    mypy python_version = 3.14
  • CI (ci.yml) lint job and test matrix both run on 3.14 (3.12 / 3.13 dropped)
  • README badge / "Requires" line, CONTRIBUTING, CLAUDE.md, CHANGELOG updated

ruff-applied py314 idioms

Retargeting ruff to py314 auto-fixed two spots (both valid 3.14+ syntax):

  • src/pychess/__main__.py: except (IndexError, FileNotFoundError, OSError):
    except IndexError, FileNotFoundError, OSError: (PEP 758 — parentheses no
    longer required)
  • src/pychess/eval_board.py: -> "EvalBoard"-> EvalBoard (safe under
    PEP 649 deferred annotation evaluation)

Tooling sync

.pre-commit-config.yaml hook revs were stale vs pyproject.toml; bumped to
match (ruff 0.16.4, mypy 2.3.1, chess 1.11.2, pytest 9.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 all
green.

On Linux, 3.14 changes the multiprocessing default from fork to forkserver.
The Lazy SMP worker already assumes spawn-style semantics (pickled payloads,
re-imports, shared memory attached by name), so forkserver is fine — CI will
confirm on Linux.

Checklist

  • ruff check . and ruff format --check . pass
  • mypy passes (strict on src/)
  • pytest passes; coverage stays >= 85%
  • Tests added or updated for the change — n/a
  • CHANGELOG.md updated under ## [Unreleased]
  • README.md / docs/*.md updated

🤖 Generated with Claude Code

- 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>
Copilot AI lite review requested due to automatic review settings August 30, 2026 13:40
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 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, mypy python_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.

@cjunius
cjunius merged commit dccd320 into main Aug 30, 2026
7 checks passed
@cjunius
cjunius deleted the chore/python-3.14 branch August 30, 2026 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants