Skip to content

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

Open
Danipulok wants to merge 1 commit into
pydantic:mainfrom
Danipulok:chore/ruff-target-version
Open

Let requires-python set the ruff target version#76
Danipulok wants to merge 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.

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.

1 participant