Skip to content
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 for PEP 639 in RUF200 #13869

Open
henryiii opened this issue Oct 21, 2024 · 2 comments · May be fixed by #13902
Open

Support for PEP 639 in RUF200 #13869

henryiii opened this issue Oct 21, 2024 · 2 comments · May be fixed by #13902
Labels
rule Implementing or modifying a lint rule
Milestone

Comments

@henryiii
Copy link
Contributor

henryiii commented Oct 21, 2024

In --preview, the following error is shown for PEP 639 style licenses:

tests/packages/spdx/pyproject.toml:5:17: RUF200 Failed to parse pyproject.toml: wanted string or table
  |
3 | version = "1.2.3"
4 | license = "MIT OR GPL-2.0-or-later OR (FSFUL AND BSD-2-Clause)"
5 | license-files = ["LICEN[CS]E*", "AUTHORS*", "licenses/LICENSE.MIT"]
  |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ RUF200

I don't fully understand the error message (license-files was never a string or table), but it would be good to support PEP 639, at least before this leaves preview (Edit: Ahh, this happens if you run ruff check . even without --preview, I always use pre-commit except for checking --preview).

@MichaReiser
Copy link
Member

Agree, we should change the validation here.

@konstin do you know why we flag license-files if it isn't a table?

@MichaReiser MichaReiser added this to the v0.8 milestone Oct 22, 2024
@MichaReiser MichaReiser added rule Implementing or modifying a lint rule help wanted Contributions especially welcome labels Oct 22, 2024
@konstin
Copy link
Member

konstin commented Oct 22, 2024

The pyproject-toml crate has an outdated version of the PEP, we need to fix this in that crate which will fix the rule.

konstin added a commit that referenced this issue Oct 24, 2024
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
@konstin konstin linked a pull request Oct 24, 2024 that will close this issue
@konstin konstin removed the help wanted Contributions especially welcome label Oct 24, 2024
MichaReiser pushed a commit that referenced this issue Oct 25, 2024
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
konstin added a commit that referenced this issue Nov 1, 2024
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rule Implementing or modifying a lint rule
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants