Skip to content

pyproject.toml: migrate to PEP 639 license expressions - #1956

Open
ejoerns wants to merge 1 commit into
labgrid-project:masterfrom
ejoerns:fix-license-identifier
Open

pyproject.toml: migrate to PEP 639 license expressions#1956
ejoerns wants to merge 1 commit into
labgrid-project:masterfrom
ejoerns:fix-license-identifier

Conversation

@ejoerns

@ejoerns ejoerns commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Description

Make license a proper SDPX license expression.
Use license-files for license files.
Replace the also-deprecated License :: classifier.

See https://setuptools.pypa.io/en/latest/userguide/license_migration.html

Fixes:

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 2027-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.
  ********************************************************************************
SetuptoolsDeprecationWarning: License classifiers are deprecated.
  !!

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

  License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)

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

Make 'license' a proper SDPX license expression.
Use 'license-files' for license files.
Replace the also-deprecated "License ::" classifier.

See https://setuptools.pypa.io/en/latest/userguide/license_migration.html

Fixes:

| 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 2027-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.
|   ********************************************************************************

| SetuptoolsDeprecationWarning: License classifiers are deprecated.
|   !!
|
|   ********************************************************************************
|   Please consider removing the following classifiers in favor of a SPDX license expression:
|
|   License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)
|
|   See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
|   ********************************************************************************

Signed-off-by: Enrico Jörns <ejo@pengutronix.de>
@codecov

codecov Bot commented Aug 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 61.0%. Comparing base (7121ff3) to head (be5ce37).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff            @@
##           master   #1956     +/-   ##
========================================
- Coverage    61.0%   61.0%   -0.1%     
========================================
  Files         182     182             
  Lines       14906   14906             
========================================
- Hits         9105    9103      -2     
- Misses       5801    5803      +2     
Flag Coverage Δ
3.10 61.0% <ø> (ø)
3.11 61.0% <ø> (-0.1%) ⬇️
3.12 61.0% <ø> (-0.1%) ⬇️
3.13 61.0% <ø> (-0.1%) ⬇️
3.14 61.0% <ø> (-0.1%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@Emantor Emantor added the pick to stable Needs a pick to the latest stable branch label Aug 14, 2026

@Bastian-Krause Bastian-Krause left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate of #1687. Needs investigation if the situation changed since then, see the comments in that PR.

@Emantor

Emantor commented Aug 14, 2026

Copy link
Copy Markdown
Member

Looks like the current recommendation for our case is to use license-files exclusively and drop license, see pypa/setuptools@a9ac944#diff-6d257eba84cbc108227977885d3a690248c666c3bf8c612fc3fcfd38264d547dR104

@Bastian-Krause

Copy link
Copy Markdown
Member

Looking at https://layers.openembedded.org/layerindex/recipe/37586/, this would likely break scarthgap.

@Bastian-Krause

Copy link
Copy Markdown
Member

Looking at https://layers.openembedded.org/layerindex/recipe/37586/, this would likely break scarthgap.

I don't think we should wait until that's EOL, but maybe a little bit longer so everybody had enough time to switch to wrynose?

I think a certain someone will need meta-labgrid on scarthgap with a recent enough version of labgrid soon. Bumping setuptools there might cause fallout for other Python packages, so I guess I would need to revert this patch then if we merge it now.

@Emantor

Emantor commented Aug 14, 2026

Copy link
Copy Markdown
Member

I thought license-files would be supported for every version of setup tools that supports project.toml?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pick to stable Needs a pick to the latest stable branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants