-
Notifications
You must be signed in to change notification settings - Fork 907
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
Support range in required-version setting #10192
Comments
I think it'd be reasonable to support |
(We just need to make it backwards-compatible such that |
I think we would need to support a full semver syntax similar to package.json engines or it might be surprising that e.g. `<= isn't supported which, IMO, is entirely reasonable too A first step before a PR is to spec out the exact behavior of that field with the supported syntax to avoid long discussions on the PR |
Correct, that’s what I meant — we should use Python’s PEP 440 and PEP 508 specifiers since they’re already native, standardized, used in the same TOML file, and we have parsers for them. I don’t think there needs to be any more decision-making than that, personally! |
Seems reasonable, although PEP440 is probably more flexible than what we need (local versions). PEP508 seems unrelated because we don't need a name portion. |
👍 The gist of it is: it should just function identically to |
## Summary Allows `required-version` to be set with a version specifier, like `>=0.3.1`. If a single version is provided, falls back to assuming `==0.3.1`, for backwards compatibility. Closes #10192.
) ## Summary Allows `required-version` to be set with a version specifier, like `>=0.3.1`. If a single version is provided, falls back to assuming `==0.3.1`, for backwards compatibility. Closes astral-sh#10192.
Currently, it appears that the
required-version
[1] setting allows just a single specific version to be specified. When a version of ruff is present that differs from this version, the ruff tool errors, preventing checks from running.The ask here is to allow range syntax, e.g.
>=
,~
, etc., or perhaps treat therequired-version
as a minimum similar totarget-version
, so that ruff does not fail to run in the scenario that e.g. a developer upgrades ruff in their environment but is working within a repo that wants to ensure that everyone is on some minimum version of ruff.[1] https://docs.astral.sh/ruff/settings/#required-version
The text was updated successfully, but these errors were encountered: