fix(check): SPDX license string; E501 off in tests (device-types pilot)

The pilot's build warned that setuptools refuses a license table and
License classifiers from 2027-02-18 (PEP 639); check now reports both and
the template builds with setuptools>=77. Recorded device output in tests
keeps its lines, so the template turns E501 off under tests/.
This commit is contained in:
christianmanivong committed 2026-10-22 19:08:06 +02:00
1 parent db6b2e4ea7
commit 0b21f62553
7 files changed
+45 -8

No files matched your search

+21 -3
View File
@@ -51,10 +51,28 @@ def test_a_missing_project_field_is_reported(make_repo: RepoFactory, field: str)
assert field in findings[0].message
def test_a_license_table_is_accepted(make_repo: RepoFactory) -> None:
pyproject = PYPROJECT.replace('license = "Apache-2.0"', 'license = { text = "Apache-2.0" }')
@pytest.mark.parametrize(
"license_line",
['license = { text = "Apache-2.0" }', 'license = { file = "LICENSE" }'],
)
def test_a_license_table_is_reported(make_repo: RepoFactory, license_line: str) -> None:
"""setuptools refuses the table form from 2027-02-18 (PEP 639)."""
pyproject = PYPROJECT.replace('license = "Apache-2.0"', license_line)
assert check_repo(make_repo({"pyproject.toml": pyproject})) == []
findings = check_repo(make_repo({"pyproject.toml": pyproject}))
assert rules(findings) == {"metadata"}
assert "SPDX" in findings[0].message
def test_a_license_classifier_is_reported(make_repo: RepoFactory) -> None:
pyproject = PYPROJECT.replace(
'requires-python = ">=3.10"\n',
'requires-python = ">=3.10"\n'
'classifiers = ["License :: OSI Approved :: Apache Software License"]\n',
)
assert rules(check_repo(make_repo({"pyproject.toml": pyproject}))) == {"metadata"}
@pytest.mark.parametrize("spec", [">=3.8", ">=3.9", ""])