Skip to content

Use SPDX string form for the license field in pyproject.toml - #35

Open
elhoim wants to merge 1 commit into
MISP:mainfrom
elhoim:fix/31-spdx-license-form
Open

Use SPDX string form for the license field in pyproject.toml#35
elhoim wants to merge 1 commit into
MISP:mainfrom
elhoim:fix/31-spdx-license-form

Conversation

@elhoim

@elhoim elhoim commented Aug 31, 2026

Copy link
Copy Markdown
Member

Finding 31 (Medium) — pyproject.toml:11,2

Problem

The PEP 621 license-table form is deprecated upstream while build-system requires setuptools>=68 with no ceiling and the workflow installs the newest build/setuptools each run, so a future setuptools release can turn today's warning into a hard build failure with no change in this repo.

Fix

pyproject.toml used the deprecated PEP 621 file-table form for project.license ({ file = "LICENSE" }). Since build-system.requires pins setuptools>=68 with no upper bound and CI installs the latest setuptools/build each run, a future setuptools release could turn today's deprecation warning into a hard build failure. Fixed by switching to the SPDX license expression string form: license = "AGPL-3.0-or-later", which matches the AGPLv3 text already in LICENSE.

Verification

Reproduced against the unmodified code at 9b8c605, then re-checked after the change.

Before
Invoked setuptools.build_meta.prepare_metadata_for_build_wheel() directly on a copy of the pyproject.toml with `license = { file = "LICENSE" }`:
WARN: SetuptoolsDeprecationWarning `project.license` as a TOML table is deprecated
!!
        ********************************************************************************
        Please use a simple string containing a SPDX expres[sion]...
After
Same call with `license = "AGPL-3.0-or-later"`: dist_info builds cleanly with no deprecation warning emitted.

python bin/cli.py --help exits 0 and the module still imports cleanly. Verification was performed offline against the pure functions — no running misp-modules instance is required.

Branched from 9b8c605. This PR addresses only this finding; the other findings from the same review are in separate PRs, so they will need rebasing against each other as they merge.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DYX4TKA5inzByJ4qGWKjqh

@elhoim elhoim changed the title Remove accidentally committed __pycache__ artifact Use SPDX string form for the license field in pyproject.toml Aug 31, 2026
The project.license field used the deprecated PEP 621 file-table form ({ file = "LICENSE" }), which setuptools>=68 already flags with a SetuptoolsDeprecationWarning. Since build-system.requires pins setuptools>=68 with no upper bound and the workflow installs the latest setuptools/build each run, a future setuptools release can turn this into a hard build failure with no change in this repo.

Switch to the SPDX license expression string form (license = "AGPL-3.0-or-later"), matching the AGPLv3 text in LICENSE. Verified by invoking setuptools.build_meta.prepare_metadata_for_build_wheel directly: the deprecation warning fires with the old file-table form and is gone after the fix.
@elhoim
elhoim force-pushed the fix/31-spdx-license-form branch from 74d6f41 to fcfe0ef Compare August 31, 2026 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant