-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
RFE: infer target-version
from project metadata
#2039
Comments
Perhaps we can use https://github.com/konstin/pep440-rs from @konstin to power the version parsing? |
FYI: black#3219 was merged and shipped with black 23.1.0 |
Black’s target version inference is currently broken: psf/black#3581. I’m currently working on a fix and would be happy to port the solution to ruff. However, before that, #2519 should be decided. |
Nice! I'm happy to support target ranges, it's just not totally clear to me what rules they would affect and how. |
Black have different behaviors depending on the versions for example. Maybe ruff formatter should do the same. |
one thing to consider is that the behavior in psf/black#3581 ( |
Should we close this issue? |
yep |
I created #3487 to track inferring this info at runtime. |
target-version
could in many cases be inferred from project metadata:Would be great to see ruff do that to eliminate one maintenance chore.
Black is moving toward doing that, too. The implementation over there is obviously somewhat different, because they still take a list of target versions whereas ruff takes the minimum one (which I think is the better, yet less flexible approach). Perhaps some of that work can be reused in ruff: psf/black#3219
The text was updated successfully, but these errors were encountered: