Skip to content

Drop support for Python 3.8 and 3.9 (require Python 3.10+) - #77

Merged
shenxianpeng merged 2 commits into
mainfrom
chore/drop-python-3.8-3.9
Aug 4, 2026
Merged

shenxianpeng merged 2 commits into
mainfrom
chore/drop-python-3.8-3.9

Conversation

@shenxianpeng

Copy link
Copy Markdown
Member

Summary

Closes #33: drop support for Python 3.8 and 3.9 (both end of life) — MkDocs now requires Python 3.10+.

What changed

  • pyproject.toml: requires-python = ">=3.10", removed the 3.8/3.9 trove classifiers, dropped the conditional importlib-metadata dependency (stdlib importlib.metadata used directly), removed 3.8/3.9 from the hatch test and integration env matrices
  • .github/workflows/ci.yml: removed 3.8 from the smoke test matrix and 3.8/3.9 from the full test matrix
  • Removed compatibility shims:
    • importlib_metadata fallbacks in plugins.py / utils/__init__.py
    • _removesuffix shim (now uses str.removesuffix directly)
    • custom insort fallback (stdlib bisect.insort(key=...) is used; kept as a re-export for utils.insort users)
  • Simplified version-specific test code (3.9.5 skip conditions, 3.10 assertion branches)
  • Applied pyupgrade modernization enabled by the raised floor (all auto-fixed by ruff, reviewed): list[T]/dict[str, T] generics, collections.abc imports (moved into TYPE_CHECKING blocks where annotation-only), functools.cache, zip(..., strict=False), parenthesized context managers, X | None annotations

Verification

  • uvx prek run -a passes (ruff, mypy, markdownlint, jshint, ...)
  • Full test suite: 753 tests OK
  • uv build wheel metadata: Requires-Python: >=3.10, no importlib-metadata in dependencies
  • CI: smoke tests now run on 3.14 / pypy-3.11 (macOS/Ubuntu/Windows), full tests on 3.10–3.14 + pypy

Notes

This is a breaking change (hence the breaking label on #33) and is planned for the 1.8.0 release. Users on Python 3.8/3.9 should stay on the 1.7.x line.

Python 3.8 and 3.9 are end of life, so MkDocs now requires Python 3.10+.

- Set requires-python to >=3.10 and drop the 3.8/3.9 trove classifiers.
- Remove the conditional importlib-metadata dependency (stdlib
  importlib.metadata is used directly on 3.10+).
- Remove the _removesuffix and insort compatibility shims; stdlib
  str.removesuffix and bisect.insort(key=...) are used directly.
- Drop 3.8/3.9 from the CI smoke/full test matrices and the hatch test
  and integration env matrices.
- Simplify tests that had Python-version-specific branches.
- Apply pyupgrade fixes enabled by the raised floor (list/dict
  generics, collections.abc imports, functools.cache, zip strict
  parameter, parenthesized context managers, X | None annotations).
@shenxianpeng shenxianpeng added the breaking breaking change label Aug 4, 2026
@shenxianpeng
shenxianpeng merged commit 7848dfd into main Aug 4, 2026
27 of 28 checks passed
@shenxianpeng
shenxianpeng deleted the chore/drop-python-3.8-3.9 branch August 4, 2026 05:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Plan to drop python3.8 and 3.9 from v1.8.0

1 participant