Skip to content

Pre-commit hooks no longer require Python 3.12 and mypy always checks as 3.12 - #1031

Merged
mauvilsa merged 1 commit into
mainfrom
precommit-any-python
Oct 30, 2026
Merged

mauvilsa merged 1 commit into
mainfrom
precommit-any-python

Conversation

@mauvilsa

Copy link
Copy Markdown
Owner

What does this PR do?

pre-commit run -a failed for anyone without Python 3.12 installed, because .pre-commit-config.yaml pinned the hooks to python3.12. This removes the pin, so the hooks run with the Python that runs pre-commit (e.g. 3.12 or 3.14).

To keep mypy results the same whatever that version is, python_version = "3.12" is added to [tool.mypy]. The pre-commit note in CONTRIBUTING.rst is updated to match.

Before submitting

  • Did you read the contributing guideline?
  • If you used a coding agent, did you fully understand and validate all generated code and ensure it follows the contributing guidelines?
  • Did you update the documentation? (readme and public docstrings)
  • [n/a] Did you write unit tests such that there is 100% coverage on related code? (required for bug fixes and new features)
  • Did you verify that new and existing tests pass locally?
  • [n/a] If this is a bug fix, did you verify that the tests fail without the code fix?
  • Did you make sure that all changes preserve backward compatibility?
  • [n/a] Did you update the CHANGELOG including a pull request link? (not for typos, docs, test updates, or minor internal changes/refactors)

@mauvilsa mauvilsa added the refactor Improvements to the quality of the code label Oct 30, 2026
@greptile-apps

greptile-apps Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

Removes the Python 3.12 requirement for Python-based pre-commit hooks while keeping mypy's target at Python 3.12.

  • Pre-commit hooks use the runner's Python while mypy checks as 3.12.

Reviews (1) · Last reviewed commit: "Pre-commit hooks no longer require Pytho..." · Reviewed by Greptile

@sonarqubecloud

Copy link
Copy Markdown

@codecov

codecov Bot commented Oct 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (b8c3925) to head (26656b5).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #1031   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           27        27           
  Lines        10046     10046           
=========================================
  Hits         10046     10046           

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

@mauvilsa
mauvilsa merged commit 2ad628c into main Oct 30, 2026
36 checks passed
@mauvilsa
mauvilsa deleted the precommit-any-python branch October 30, 2026 23:00

This branch was previously deployed

1 inactive deployment
sonarcloud — 26656b5b Deployed Oct 30, 2026 by mauvilsa via sonarcloud #1024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Improvements to the quality of the code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant