borg icon indicating copy to clipboard operation
borg copied to clipboard

SetuptoolsDeprecationWarning: `project.license`, `project.license-files`, "License classifiers"

Open FelixSchwarz opened this issue 8 months ago • 2 comments

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()

FelixSchwarz avatar Apr 19 '25 10:04 FelixSchwarz

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).

ThomasWaldmann avatar Apr 19 '25 10:04 ThomasWaldmann

Fixed in master by #8774.

ThomasWaldmann avatar Apr 19 '25 19:04 ThomasWaldmann

@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)?

ThomasWaldmann avatar Aug 03 '25 04:08 ThomasWaldmann

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.

FelixSchwarz avatar Aug 03 '25 05:08 FelixSchwarz

The patch in master branch looks like that: https://github.com/borgbackup/borg/pull/8774/files

ThomasWaldmann avatar Aug 03 '25 11:08 ThomasWaldmann

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.

FelixSchwarz avatar Aug 03 '25 13:08 FelixSchwarz

We'll try in next release (1.4.2), see #8983.

ThomasWaldmann avatar Aug 08 '25 15:08 ThomasWaldmann

fixed in master and 1.4-maint now, 1.2-maint will likely not produce new releases anymore.

ThomasWaldmann avatar Aug 08 '25 19:08 ThomasWaldmann