Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ build = ">=0.10.0"
setuptools = ">=60"
tomli-w = "^1.0.0"
virtualenv = ">=20.21"
trove-classifiers = ">=2022.5.19"

[tool.poetry.group.typing.dependencies]
mypy = ">=1.0"
Expand Down
2 changes: 2 additions & 0 deletions src/poetry/core/spdx/license.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ class License(namedtuple("License", "id name is_osi_approved is_deprecated")):

CLASSIFIER_NAMES: ClassVar[dict[str, str]] = {
# Not OSI Approved
"Aladdin": "Aladdin Free Public License (AFPL)",
"AFPL": "Aladdin Free Public License (AFPL)",
"CC0-1.0": "CC0 1.0 Universal (CC0 1.0) Public Domain Dedication",
"CECILL-B": "CeCILL-B Free Software License Agreement (CECILL-B)",
Expand Down Expand Up @@ -107,6 +108,7 @@ class License(namedtuple("License", "id name is_osi_approved is_deprecated")):
"CECILL-2.1": "CEA CNRS Inria Logiciel Libre License, version 2.1 (CeCILL-2.1)",
"CPL-1.0": "Common Public License",
"EPL-1.0": "Eclipse Public License 1.0 (EPL-1.0)",
"EPL-2.0": "Eclipse Public License 2.0 (EPL-2.0)",
"EFL-1.0": "Eiffel Forum License",
"EFL-2.0": "Eiffel Forum License",
"EUPL-1.1": "European Union Public Licence 1.1 (EUPL 1.1)",
Expand Down
15 changes: 15 additions & 0 deletions tests/spdx/test_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import pytest

from poetry.core.spdx.helpers import _load_licenses
from poetry.core.spdx.helpers import license_by_id


Expand Down Expand Up @@ -52,3 +53,17 @@ def test_license_by_id_custom() -> None:
assert license.name == "Custom"
assert not license.is_osi_approved
assert not license.is_deprecated


def test_valid_trove_classifiers() -> None:
import trove_classifiers

licenses = _load_licenses()

for license_id, license in licenses.items():
classifier = license.classifier
valid_classifier = classifier in trove_classifiers.classifiers

assert (
valid_classifier
), f"'{license_id}' returns invalid classifier '{classifier}'"