scapy icon indicating copy to clipboard operation
scapy copied to clipboard

SetuptoolsDeprecationWarnings: "`project.license` as a TOML table is deprecated" and "License classifiers are deprecated"

Open evverx opened this issue 2 months ago • 5 comments

Brief description

Currently the following warnings are produced:

python3 -m build
...
/tmp/build-env-p37ku9pr/lib64/python3.14/site-packages/setuptools/config/_apply_pyprojecttoml.py:82: SetuptoolsDeprecationWarning: `project.license` as a TOML table is deprecated
!!

        ********************************************************************************
        Please use a simple string containing a SPDX expression for `project.license`. You can also use `project.license-files`. (Both options available on setuptools>=77.0.0).

        By 2026-Feb-18, you need to update your project and remove deprecated calls
        or your builds will no longer be supported.

        See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
        ********************************************************************************

!!
...
/tmp/build-env-p37ku9pr/lib64/python3.14/site-packages/setuptools/config/_apply_pyprojecttoml.py:61: SetuptoolsDeprecationWarning: License classifiers are deprecated.
!!

        ********************************************************************************
        Please consider removing the following classifiers in favor of a SPDX license expression:

        License :: OSI Approved :: GNU General Public License v2 (GPLv2)

        See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
        ********************************************************************************

!!

Looks like it should be fine to remove the license classifier but the "project.license as a TOML table is deprecated" warning appears to be controversial in that it can break downstream packages and things like that: https://github.com/pypa/setuptools/issues/4903. It would probably make sense to wait and see: https://github.com/pypa/setuptools/issues/5081.

Scapy version

4317859ce0ada5a779c589b77d9547d384064185

Python version

Python 3.14.0rc3

Operating system

Linux 6.16.8

Additional environment information

No response

How to reproduce

python3 -m build with setuptools >= 77

Actual result

No response

Expected result

No response

Related resources

No response

evverx avatar Oct 01 '25 11:10 evverx

Thanks for the report !

Sadly there's an incompatibility with the last version of setup tools that supports Python 3.7 and this new format, so it means we have to drop support for it, or find a workaround.

This is something we need to discuss. Tagging @p-l- @guedou @polybassa for input

gpotter2 avatar Oct 03 '25 19:10 gpotter2

It isn't compatible with Python 3.8 either.

As far as I understand it should be possible to remove the field altogether by analogy with https://github.com/cvc5/cvc5/pull/11952 (where the license field was just yeeted by following I assume option 4 mentioned in https://github.com/pypa/setuptools/issues/4903#issuecomment-2741522686):

Remove license expressions from the configuration files and instead rely on the automatic license file inclusion for the well-known license file paths (e.g., LICENSE at the root of the project). You would still be distributing license info in the form of license files (which at the end of the day is what counts... SPDX indexes are at the best an approximate proxy for the license file, re-distributors would still have to read the file themselves).

That's probably not what PEP 639 was supposed to accomplish though.

evverx avatar Oct 03 '25 23:10 evverx

Should we do Scapy 2.7.0 release then remove all interpreters that are now or soon be EOL (i.e. keep 3.10 and up only)?

guedou avatar Oct 04 '25 12:10 guedou

Should we do Scapy 2.7.0 release then remove all interpreters that are now or soon be EOL

I think it depends on whether scapy 2.7.0 should be buildable with the latest toolchains. If it was tagged without changing pyproject.toml it would fail to build with setuptools where licenses as TOML tables are no longer supported (and that should happen around 2026-Feb-18).

Personally I can patch those things so I can live with that.

evverx avatar Oct 04 '25 13:10 evverx

What we'll do is have 2.7.0 be the last supporting Python 3.7 and 3.8. I've added a deprecation notice to the release notes.

gpotter2 avatar Nov 02 '25 21:11 gpotter2