Skip to content

chore: drop Python 3.9 support - #424

Merged
shenxianpeng merged 5 commits into
mainfrom
chore/drop-python-3-9
Jun 13, 2026
Merged

chore: drop Python 3.9 support#424
shenxianpeng merged 5 commits into
mainfrom
chore/drop-python-3-9

Conversation

@shenxianpeng

@shenxianpeng shenxianpeng commented Jun 4, 2026

Copy link
Copy Markdown
Member

Summary

Drop support for Python 3.9 as requested in #423.

Changes

  • pyproject.toml: Bump requires-python from >=3.9 to >=3.10, remove Python 3.9 trove classifier, simplify tomli dependency (no conditional needed since min is 3.10)
  • .github/workflows/main.yml: Remove Python 3.9 from the install test matrix
  • CONTRIBUTING.md: Update prerequisite from "Python 3.9 or newer" to "Python 3.10 or newer"

Closes #423

Summary by CodeRabbit

  • Chores
    • Minimum Python version requirement raised from 3.9 to 3.10
    • Continuous integration adjusted to test against Python 3.10–3.14
    • Project metadata updated to reflect Python >=3.10 and simplified a conditional dependency constraint

- Bump requires-python from >=3.9 to >=3.10
- Remove Python 3.9 trove classifier
- Remove Python 3.9 from CI install test matrix
- Update contributing guide prerequisite to Python 3.10+

Closes #423
@shenxianpeng
shenxianpeng requested a review from a team as a code owner June 4, 2026 20:51
@netlify

netlify Bot commented Jun 4, 2026

Copy link
Copy Markdown

Deploy Preview for commit-check ready!

Name Link
🔨 Latest commit 62e7c9e
🔍 Latest deploy log https://app.netlify.com/projects/commit-check/deploys/6a2cebb16e582900082deb7b
😎 Deploy Preview https://deploy-preview-424--commit-check.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Jun 4, 2026
@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@shenxianpeng, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 7 minutes and 28 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more credits in the billing tab to continue.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 48d6d1f9-03fa-4801-9424-c4753b2a4471

📥 Commits

Reviewing files that changed from the base of the PR and between a64016b and 62e7c9e.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (11)
  • .github/workflows/main.yml
  • commit_check/api.py
  • commit_check/config.py
  • commit_check/config_merger.py
  • commit_check/engine.py
  • commit_check/main.py
  • commit_check/py.typed
  • commit_check/rule_builder.py
  • commit_check/rules_catalog.py
  • commit_check/util.py
  • pyproject.toml
📝 Walkthrough

Walkthrough

The PR removes Python 3.9 support and standardizes on Python 3.10+ across CI, contributor documentation, and package metadata (pyproject.toml and MyPy configuration).

Changes

Drop Python 3.9 Support

Layer / File(s) Summary
Python 3.9 support removal
pyproject.toml, pyproject.toml, .github/workflows/main.yml, CONTRIBUTING.md
requires-python raised to >=3.10, tomli>=1.1.0 made unconditional, MyPy python_version = "3.10" set, CI matrix drops 3.9 (runs 3.10–3.14), and CONTRIBUTING prerequisites updated to 3.10+.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

Possibly related PRs

Suggested labels

enhancement

Poem

🐰 Farewell, dear 3.9, your hops were kind and bright,
3.10’s breeze now spreads a braver light.
CI, tomli, and docs all take a leap,
Into fresh fields where new bytes sleep. 🥕✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: dropping Python 3.9 support, which is reflected across all modified files.
Linked Issues check ✅ Passed All coding requirements from issue #423 are met: Python 3.9 removed from CI matrix, requires-python updated to >=3.10, trove classifier removed, and documentation updated.
Out of Scope Changes check ✅ Passed All changes are directly related to dropping Python 3.9 support; the mypy configuration update aligns with the new minimum version.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/drop-python-3-9

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov

codecov Bot commented Jun 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.95%. Comparing base (6fb72d3) to head (62e7c9e).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #424      +/-   ##
==========================================
+ Coverage   95.93%   95.95%   +0.02%     
==========================================
  Files          10       10              
  Lines        1155     1162       +7     
==========================================
+ Hits         1108     1115       +7     
  Misses         47       47              

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@shenxianpeng shenxianpeng added breaking This is a breaking change and removed documentation Improvements or additions to documentation labels Jun 4, 2026
Match mypy's type-checking target to the new minimum supported
Python version after dropping 3.9 support.
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Jun 4, 2026

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🧹 Nitpick comments (1)
pyproject.toml (1)

17-17: ⚡ Quick win

Consider restoring the environment marker for tomli.

The dependency was changed from conditional (tomli>=1.1.0; python_version < '3.11') to unconditional. Since Python 3.11+ includes tomllib in the standard library, installing tomli on those versions is unnecessary. Restoring the conditional marker would avoid wasting disk space and install time.

♻️ Suggested dependency declaration
 dependencies = [
     "pyyaml",
-    "tomli>=1.1.0",
+    "tomli>=1.1.0; python_version < '3.11'",
 ]

Based on learnings: Use tomllib (Python 3.11+) or tomli fallback for TOML file parsing in config.py. The conditional marker aligns with this fallback pattern.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pyproject.toml` at line 17, Restore the environment marker on the tomli
dependency in pyproject.toml so it only installs for Python versions that lack
tomllib (e.g., change "tomli>=1.1.0" back to "tomli>=1.1.0; python_version <
'3.11'"); update any related import/fallback logic in config.py (where
tomllib/tomli are used) to continue preferring tomllib on Python 3.11+ and
fallback to tomli otherwise.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@CONTRIBUTING.md`:
- Line 87: CONTRIBUTING.md and pyproject.toml declare Python >=3.10 but uv.lock
still lists requires-python = ">=3.9"; regenerate the lockfile so uv.lock's
metadata matches pyproject.toml by running your lock generation command (e.g.,
poetry/uvicorn lock regen or the project's standard lock update command) and
commit the updated uv.lock, ensuring the requires-python field in uv.lock
reflects ">=3.10" to align with pyproject.toml and CONTRIBUTING.md.

---

Nitpick comments:
In `@pyproject.toml`:
- Line 17: Restore the environment marker on the tomli dependency in
pyproject.toml so it only installs for Python versions that lack tomllib (e.g.,
change "tomli>=1.1.0" back to "tomli>=1.1.0; python_version < '3.11'"); update
any related import/fallback logic in config.py (where tomllib/tomli are used) to
continue preferring tomllib on Python 3.11+ and fallback to tomli otherwise.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3307c149-b233-42ee-bde4-27a646fc8ce8

📥 Commits

Reviewing files that changed from the base of the PR and between 2f238e0 and 2a9953e.

📒 Files selected for processing (3)
  • .github/workflows/main.yml
  • CONTRIBUTING.md
  • pyproject.toml

Comment thread CONTRIBUTING.md
@codspeed-hq

codspeed-hq Bot commented Jun 4, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 309 untouched benchmarks
⏩ 108 skipped benchmarks1


Comparing chore/drop-python-3-9 (62e7c9e) with main (6fb72d3)

Open in CodSpeed

Footnotes

  1. 108 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

- Replace Optional[X] with X | None (PEP 604, native in 3.10)
- Replace List[X], Dict[K,V], Tuple[...], Type[X] with
  list[X], dict[K,V], tuple[...], type[X] (PEP 585, native in 3.9)
- Add from __future__ import annotations for forward-reference safety
- Use collections.abc.Callable instead of typing.Callable
- Keep typing.Any (no native replacement)

All 217 tests pass.
@shenxianpeng shenxianpeng removed the documentation Improvements or additions to documentation label Jun 4, 2026
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Jun 13, 2026
- Regenerate uv.lock (requires-python >=3.10, drop all <3.10 markers)
- Restore tomli conditional marker (python_version < '3.11')
- Add py.typed marker (PEP 561) for downstream type checkers
- Tighten CheckOutcome.to_dict() return type to dict[str, str]
- Tighten validate_config() return type to dict[str, Any]
@sonarqubecloud

Copy link
Copy Markdown

@shenxianpeng shenxianpeng added minor A minor version bump and removed documentation Improvements or additions to documentation labels Jun 13, 2026
@shenxianpeng
shenxianpeng merged commit f02b845 into main Jun 13, 2026
32 checks passed
@shenxianpeng
shenxianpeng deleted the chore/drop-python-3-9 branch June 13, 2026 05:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking This is a breaking change minor A minor version bump

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Drop Python 3.9 support

1 participant