Skip to content

Remove explicit target-version field for ruff#15400

Merged
srittau merged 1 commit intopython:mainfrom
srittau:rm-ruff-py-version
Feb 9, 2026
Merged

Remove explicit target-version field for ruff#15400
srittau merged 1 commit intopython:mainfrom
srittau:rm-ruff-py-version

Conversation

@srittau
Copy link
Collaborator

@srittau srittau commented Feb 9, 2026

This is inferred from project.requires-python

This is inferred from project.requires-python
@srittau srittau requested a review from AlexWaygood February 9, 2026 11:33
@srittau
Copy link
Collaborator Author

srittau commented Feb 9, 2026

Part of #15358.

@AlexWaygood
Copy link
Member

AlexWaygood commented Feb 9, 2026

This is the same as project.requires-python now, but it seems semi-plausible that we might again have a situation in the future where the version we require for our tests (project.requires-python) is higher than our minimum supported Python version for our stubs — and we probably want the target version for ruff to reflect the latter rather than the former? Explicitly specifying the target version here for Ruff might be helpful for reminding us that these two things don't necessarily need to be the same.

That said, I don't have a strong opinion; either is probably fine

@srittau
Copy link
Collaborator Author

srittau commented Feb 9, 2026

This is the same as project.requires-python now, but it seems semi-plausible that we might again have a situation in the future where the version we require for our tests (project.requires-python) is higher than our minimum supported Python version for our stubs — and we probably want the target version for ruff to reflect the latter rather than the former?

My main problem with target-version is that it's easy to overlook, since its format (310) differs from the usual format (3.10). I also wonder whether we should really use project.requires-python for the tests, and the custom field tool.typeshed.oldest_supported_python for the project itself. This seems to be more of an historical accident than a logical use of the fields.

For now, lets remove it. It can easily be restored later.

@srittau srittau merged commit 7ff653f into python:main Feb 9, 2026
45 checks passed
@srittau srittau deleted the rm-ruff-py-version branch February 9, 2026 13:17
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