-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ruff target-version
can be automatically inferred if requires-python
is set
#201
Comments
This sounds great. I’d go with allowing either for now, as you have above, and later we could make having both disallowed. |
(I suspect this might be somewhat new. Also wondering how it handles more complex version boudaries) |
Do you want me to submit a corresponding PR?
The feature was requested in astral-sh/ruff#2039 and implemented in astral-sh/ruff#3470 on March 13, which went into |
Sure, please do. |
(FYI, this check was added in repo-review 0.5, https://github.com/scientific-python/repo-review/releases/tag/v0.5.0 - in February, which explains why it didn't have this :) ) |
* Remove target-version from Black and Ruff metadata in pyproject.toml. - c.f. scientific-python/cookie#201
According to https://beta.ruff.rs/docs/settings/#target-version, the
target-version
property used for ruff can be inferred from theproject.requires-python
field, if it is present.Repo-review currently requires the
target-version
to be set incookie/src/sp_repo_review/checks/ruff.py
Lines 35 to 50 in 884ef32
Based on the above, this check could be relaxed a little. Maybe to something like:
Or even something where it is suggested to not specify
tool.ruff.target-version
wheneverproject.requires-python
is specified.The text was updated successfully, but these errors were encountered: