Skip to content

Commit b696b14

Browse files
committed
Add check that Deprecated Trove classifiers are not used.
1 parent 9475432 commit b696b14

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ authors = [
1010
]
1111
description = "Review repos for compliance to the Scientific-Python development guidelines"
1212
requires-python = ">=3.10"
13+
license-expression = 'BSD-3-Clause'
1314
classifiers = [
1415
"Development Status :: 4 - Beta",
1516
"Environment :: Console",
1617
"Environment :: WebAssembly :: Emscripten",
1718
"Intended Audience :: Developers",
1819
"Intended Audience :: Science/Research",
19-
"License :: OSI Approved :: BSD License",
2020
"Operating System :: OS Independent",
2121
"Programming Language :: Python :: 3",
2222
"Programming Language :: Python :: 3.10",

src/sp_repo_review/checks/pyproject.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,24 @@ def check(pyproject: dict[str, Any], package: Traversable) -> bool | None:
9494
return None
9595

9696

97+
class PP005(PyProject):
98+
"Does not have deprecated trove classifiers"
99+
100+
url = mk_url("packaging-simple")
101+
102+
@staticmethod
103+
def check(pyproject: dict[str, Any], package: Traversable) -> bool | None:
104+
"""
105+
As of Pypi metadata 2.4, all the `License ::` classifiers are deprecated.
106+
Prefer the `License-Expression`
107+
108+
See https://packaging.python.org/en/latest/specifications/core-metadata/#license-expression
109+
"""
110+
match pyproject:
111+
case {"project": {"classifiers": classifiers}}:
112+
return len([c for c in classifiers if c.startswith("License ::")]) == 0
113+
114+
97115
class PP301(PyProject):
98116
"Has pytest in pyproject"
99117

0 commit comments

Comments
 (0)