SetuptoolsDeprecationWarning: `project.license`, `project.license-files`, "License classifiers"
When building the project in Fedora, I get these warnings:
[4/6] Cythonizing src/borg/crypto/low_level.pyx
/usr/lib/python3.13/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.
********************************************************************************
!!
corresp(dist, value, root_dir)
/usr/lib/python3.13/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 :: BSD License
See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
********************************************************************************
!!
dist._finalize_license_expression()
/usr/lib/python3.13/site-packages/setuptools/dist.py:759: SetuptoolsDeprecationWarning: License classifiers are deprecated.
!!
********************************************************************************
Please consider removing the following classifiers in favor of a SPDX license expression:
License :: OSI Approved :: BSD License
See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
********************************************************************************
!!
self._finalize_license_expression()
Yes, I am aware of these.
Should get fixed in master, but I guess not yet in 1.4-maint or 1.2-maint as project.license and project.license-files require a very recent setuptools (which might be not yet available everywhere).
Fixed in master by #8774.
@FelixSchwarz unsure about the consequences of backporting this to 1.4-maint:
If a linux dist has borg 1.4.x and I raise the minimum requirement for setuptools, will that block adoption for that dist (because it provides only an older setuptools)?
Good point. RHEL 9 ships setuptools 53.0 which I think is too old for license-files. This wouldn't be a hard blocker for EPEL though because I could just add a patch which basically reverts the change.
I did not look into the exact reason why setuptools does raise the reported warning but from error message I think we might only need a SPDX classifier which I hope is fine even in old versions of setuptools. Probably I am missing something here.
The patch in master branch looks like that: https://github.com/borgbackup/borg/pull/8774/files
Yeah, I saw the patch but somehow did not remember my original post which also references "project.license-files". If you like, I can try to take a look on how to backport this best for 1.4 (can do this on Wed/Thu) but in the end I guess I might have to add a small patch to EPEL.
We'll try in next release (1.4.2), see #8983.
fixed in master and 1.4-maint now, 1.2-maint will likely not produce new releases anymore.