Skip to content

chore: require python 3.11 or newer - #1719

Merged
JP-Ellis merged 2 commits into
mainfrom
chore/drop-python-3.10
Oct 14, 2026
Merged

JP-Ellis merged 2 commits into
mainfrom
chore/drop-python-3.10

Conversation

@JP-Ellis

Copy link
Copy Markdown
Member

✈️ Pre-flight checklist

  • I have read the Contributing Guidelines on pull requests.
  • If this is a code change: I have written unit tests and/or added dogfooding pages to fully verify the new behavior.
  • If this is a new API or substantial change: the PR has an accompanying issue (closes #0000) and the maintainers have approved on my working plan.

📝 Summary

Raises the minimum supported Python to 3.11 across pact-python, pact-python-ffi, pact-python-cli and the examples. The docs build is fixed by the dependency bumps that this unblocks.

  1. chore: require python 3.11 or newer
    • requires-python, classifiers and hatch matrices move to 3.11. The matrices and classifiers also gain 3.15.
    • CI tests the oldest and newest supported versions, now 3.11 and 3.15. The docs and test jobs run on 3.11, and the FFI and CLI release wheels build for cp311.
    • Ruff now targets 3.11. Self comes from typing and datetime.UTC replaces timezone.utc. The typing-extensions dependencies that only provided Self are gone. The runtime dependency stays for deprecated on Python < 3.13.
    • The examples drop their workaround for ISO 8601 offsets without a colon, which datetime.fromisoformat handles from 3.11.
  2. chore(deps): update docs dependencies
    • mkdocstrings 1.0.7, griffe-pydantic 1.3.2, griffe-warnings-deprecated 1.1.2 and mkdocs-llmstxt 0.5.1. All four require Python 3.11.

🔥 Motivation

pymdown-extensions 12.2 (2026-10-10) made md a required argument of Highlight.__init__. mkdocstrings 1.0.6 doesn't pass it, so mkdocs build fails with a TypeError on main and on every open PR. mkdocstrings 1.0.7 fixes this but drops Python 3.10, as do the griffe and llmstxt patch releases. Renovate's bumps for them fail to resolve on the 3.10 CI jobs.

The alternatives were pinning pymdown-extensions<12.2 or moving only the tooling jobs to 3.11. Python 3.10 reached end of life on 2026-10-04, so the project-wide bump avoids carrying a pin that the next docs release would break again.

🔨 Test Plan

All on Python 3.11 locally:

  • hatch run typecheck: clean
  • hatch run test: 528 passed, 14 skipped
  • hatch run example: 23 passed
  • hatch run docs-build: builds
  • ruff check and ruff format: clean

The 3.15 hatch env resolves all dependencies and collects the full test suite. CI's 3.15 jobs are the first full run on it.

🔗 Related issues/PRs

Supersedes #1708, #1709, #1710 and #1715. Those Renovate PRs can close once this merges.

Python 3.10 reached end of life on 2026-10-04, and the docs toolchain has
already moved on: mkdocstrings 1.0.7, griffe-pydantic 1.3.2,
griffe-warnings-deprecated 1.1.2 and mkdocs-llmstxt 0.5.1 all require
3.11. mkdocstrings 1.0.7 carries the fix for pymdown-extensions 12.2,
whose new `Highlight` signature breaks the docs build on every branch.

Raise `requires-python` to 3.11 for pact-python, pact-python-ffi,
pact-python-cli and the examples. CI tests the oldest and newest
supported versions, now 3.11 and 3.15; the hatch matrices and
classifiers gain 3.15. The abi3 FFI wheel and the CLI wheels build
against cp311.

With ruff targeting 3.11:

- `Self` comes from `typing`, so the `typing-extensions` dependency
  is gone from the examples, the FFI `types` group and the root
  `types` group. The runtime dependency stays for `deprecated` on
  Python < 3.13.
- `datetime.UTC` replaces `timezone.utc`.
- The examples drop their workaround for ISO 8601 offsets without a
  colon, which `datetime.fromisoformat` accepts from 3.11.

Assisted-by: Claude Code:claude-opus-5-5
pymdown-extensions 12.2 made `md` a required argument of
`Highlight.__init__`, which mkdocstrings 1.0.6 does not pass, so every
docs build fails with a `TypeError`. mkdocstrings 1.0.7 passes it.

The griffe-pydantic, griffe-warnings-deprecated and mkdocs-llmstxt
patch releases come along because, like mkdocstrings 1.0.7, they
needed the Python 3.11 floor before they would resolve.

Assisted-by: Claude Code:claude-opus-5-5
@codecov

codecov Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74%. Comparing base (c98c299) to head (77cd346).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@         Coverage Diff          @@
##           main   #1719   +/-   ##
====================================
  Coverage    74%     74%           
====================================
  Files        36      36           
  Lines      4109    4109           
====================================
  Hits       3063    3063           
  Misses     1046    1046           
Flag Coverage Δ
examples 36% <ø> (ø)
tests 73% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@JP-Ellis
JP-Ellis merged commit 720f3cd into main Oct 14, 2026
41 checks passed
@JP-Ellis
JP-Ellis deleted the chore/drop-python-3.10 branch October 14, 2026 11:04
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.

1 participant