-
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
Update pyproject-toml to support PEP 639 #13902
base: main
Are you sure you want to change the base?
Conversation
@@ -0,0 +1,4 @@ | |||
--- | |||
source: crates/ruff_linter/src/rules/ruff/mod.rs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This now became a valid example
--- | ||
source: crates/ruff_linter/src/rules/ruff/mod.rs | ||
--- | ||
pyproject.toml:10:16: RUF200 Failed to parse pyproject.toml: Expected package name starting with an alphanumeric character, found '.' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, we only emit a single error when various things are broken
@@ -1,13 +1,13 @@ | |||
--- | |||
source: crates/ruff_linter/src/rules/ruff/mod.rs | |||
--- | |||
pyproject.toml:6:84: RUF200 Failed to parse pyproject.toml: invalid type: integer `1`, expected a string | |||
pyproject.toml:5:11: RUF200 Failed to parse pyproject.toml: a table with 'name' and/or 'email' keys |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error message isn't ideal but the span should sufficiently prompt users to fix their authors table
CodSpeed Performance ReportMerging #13902 will improve performances by 5.21%Comparing Summary
Benchmarks breakdown
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. This looks good. Unfortunately, we need to find a solution for wasm :(
|
code | total | + violation | - violation | + fix | - fix |
---|---|---|---|---|---|
RUF200 | 2 | 2 | 0 | 0 | 0 |
Linter (preview)
ℹ️ ecosystem check detected linter changes. (+2 -0 violations, +0 -0 fixes in 1 projects; 53 projects unchanged)
apache/airflow (+2 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview --select ALL
+ clients/python/pyproject.toml:27:1: RUF200 Failed to parse pyproject.toml: invalid type: map, expected a sequence + pyproject.toml:58:1: RUF200 Failed to parse pyproject.toml: invalid type: map, expected a sequence
Changes by rule (1 rules affected)
code | total | + violation | - violation | + fix | - fix |
---|---|---|---|---|---|
RUF200 | 2 | 2 | 0 | 0 | 0 |
Formatter (stable)
✅ ecosystem check detected no format changes.
Formatter (preview)
✅ ecosystem check detected no format changes.
eb173b5
to
92d281a
Compare
I went ahead and disabled the |
Looking at the ecosystem changes, it seems that we'll now create diagnostic for the old definition related to |
I don't think so, that syntax was only part of a draft and never of any (provisionally) accepted PEP. It makes sense to lint against it to migrate the early adopters to the final version (and i'm expecting that hatch will migrate, too). |
Let's make this a breaking change. |
@konstin added wasm upstream. We can roll-back my rule exclusion once the new version is out. See PyO3/pyproject-toml-rs@2ed4df2 |
PEP 639 is provisionally accepted, we were previously shipping definitions from an earlier draft. We don't validate all that's in the PEP (`license` vs. `license-files` compatibility, SPDX expressions), only the overall structure of pyproject.toml. Updates pep440_rs in the process. Fixes #13869
92d281a
to
6a54d3b
Compare
PEP 639 is provisionally accepted, we were previously shipping definitions from an earlier draft.
We don't validate all that's in the PEP (
license
vs.license-files
compatibility, SPDX expressions), only the overall structure of pyproject.toml.Updates pep440_rs in the process.
Fixes #13869