Skip to content

Let requires-python set the ruff target version - #76

Merged
Viicos merged 1 commit into
pydantic:mainfrom
Danipulok:chore/ruff-target-version
Sep 16, 2026
Merged

Viicos merged 1 commit into
pydantic:mainfrom
Danipulok:chore/ruff-target-version

Conversation

@Danipulok

Copy link
Copy Markdown
Contributor

What

Delete target-version = "py39" from [tool.ruff], and rewrite the two isinstance calls that the raised target flags.

Why

requires-python is >=3.10, so ruff was linting the package against a floor two releases below the one it declares.

Deleting the key rather than updating it means it cannot drift again: when target-version is absent, ruff reads the floor from requires-python.

The higher target surfaces two UP038 findings in run_code.py. Both are rewritten to the X | Y form, which isinstance has accepted since 3.10.

How to test

make lint, make typecheck and the test suite. No behaviour change.

@Viicos Viicos left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @Danipulok

@Viicos
Viicos merged commit 47bfcc2 into pydantic:main Sep 16, 2026
10 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