Skip to content

Set ruff target-version to lowest supported python version#880

Merged
mhils merged 6 commits intomitmproxy:mainfrom
clbarnes:py310
Apr 10, 2026
Merged

Set ruff target-version to lowest supported python version#880
mhils merged 6 commits intomitmproxy:mainfrom
clbarnes:py310

Conversation

@clbarnes
Copy link
Copy Markdown
Contributor

@clbarnes clbarnes commented Apr 10, 2026

The previous .python-version = 3.14.0 meant that development environments would automatically be set up using this later python version rather than the oldest supported. This changes it to 3.10.11, the latest bugfix release of python 3.10, discouraging developers from using unsupported python features.

This allows local linting to check for use of unsupported python features.

@clbarnes clbarnes marked this pull request as ready for review April 10, 2026 12:19
@clbarnes
Copy link
Copy Markdown
Contributor Author

We could extend the tox config to run tests or at least basic lints against every supported version.

@mhils
Copy link
Copy Markdown
Member

mhils commented Apr 10, 2026

I think 3.14 is the correct choice. We do need to test features that not present in the oldest supported version during development. We do have CI to catch unintended usage of newer features in the main codebase.

@clbarnes
Copy link
Copy Markdown
Contributor Author

Yes, mypy lacks a per-file target version like ruff has. This was raised here python/mypy#19892 , which was closed in favour of python/mypy#19923 , which was then rejected as impossible (where the original request probably isn't 🙃).

I agree that 3.14 is required for the moment because otherwise mypy will trip up on those misc_py* files. However, I believe that some kind of config to make sure developers don't start using future features and then have to unravel their work based on CI feedback would be welcome. Setting the ruff target-version might do it, I'll do that.

@clbarnes clbarnes changed the title Use the latest-patch lowest-supported python version Set ruff target-version to lowest supported python version Apr 10, 2026
Copy link
Copy Markdown
Member

@mhils mhils left a comment

Choose a reason for hiding this comment

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

Thanks!

@mhils mhils enabled auto-merge (squash) April 10, 2026 13:27
@mhils mhils merged commit 72ea209 into mitmproxy:main Apr 10, 2026
14 checks passed
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.

2 participants