Skip to content

chore: update licensing metadata to follow modern standards#1314

Merged
Czaki merged 2 commits intodevelopfrom
fix_licensing_meta
Oct 13, 2025
Merged

chore: update licensing metadata to follow modern standards#1314
Czaki merged 2 commits intodevelopfrom
fix_licensing_meta

Conversation

@Czaki
Copy link
Collaborator

@Czaki Czaki commented Oct 10, 2025

Resolve warnings:

adding license file 'License.txt'
writing manifest file 'package/PartSeg.egg-info/SOURCES.txt'
/home/czaki/.cache/uv/builds-v0/.tmpPch8eG/lib/python3.11/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)
/home/czaki/.cache/uv/builds-v0/.tmpPch8eG/lib/python3.11/site-packages/setuptools/config/_apply_pyprojecttoml.py:55: SetuptoolsDeprecationWarning: 'tool.setuptools.license-files' is deprecated in favor of 'project.license-files' (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-files for details.
        ********************************************************************************

!!
  _apply_tool_table(dist, config, filename)
/home/czaki/.cache/uv/builds-v0/.tmpPch8eG/lib/python3.11/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()
/home/czaki/.cache/uv/builds-v0/.tmpPch8eG/lib/python3.11/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()

Summary by CodeRabbit

  • Documentation

    • Standardized package license to BSD-3-Clause in project metadata for consistent display across platforms.
    • Removed redundant readme/license metadata entries to avoid duplication.
  • Chores

    • Consolidated license information under the main project metadata while preserving reference to License.txt.
    • Updated packaging build requirements to a newer setuptools baseline; no functional changes to the application.

@Czaki Czaki added this to the 0.16.4 milestone Oct 10, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 10, 2025

Walkthrough

Updated pyproject.toml to change licensing and build metadata: added [project] license and license-files, removed BSD license classifier, removed [project.readme] and [project.license] blocks, removed license-files under [tool.setuptools], and bumped setuptools requirement.

Changes

Cohort / File(s) Summary
Project metadata and licensing
pyproject.toml
- Added license = "BSD-3-Clause" and license-files = ["License.txt"] under [project].
- Removed BSD license classifier from classifiers.
- Removed [project.readme] and [project.license] blocks.
- Removed license-files entry under [tool.setuptools].
- Updated build-system.requires from setuptools>=61.2.0 to setuptools>=77.0.0.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

I twitch my nose at TOML lines,
A hop, a skip—the license shines.
Classifiers trimmed, the fields align,
BSD-3-Clause now signs the sign.
I thump my paw—metadata fine.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title clearly states that this PR updates licensing metadata to follow modern standards, reflecting the modifications in pyproject.toml. It succinctly describes the main objective of addressing deprecation warnings and modernizing packaging metadata. The wording is concise, specific, and avoids unnecessary noise.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix_licensing_meta

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cd18967 and 1627987.

📒 Files selected for processing (1)
  • pyproject.toml (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • pyproject.toml
⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (22)
  • GitHub Check: 4DNucleome.PartSeg (Tests_linux test_linux)
  • GitHub Check: 4DNucleome.PartSeg (Tests_other test windows)
  • GitHub Check: 4DNucleome.PartSeg (Tests_other test macos)
  • GitHub Check: Base py3.11 / macos-15-intel py 3.11 latest PyQt5
  • GitHub Check: Base py3.12 / ubuntu-24.04 py 3.12 latest PyQt5
  • GitHub Check: Base py3.10 / ubuntu-24.04 py 3.10 latest PySide6
  • GitHub Check: Base py3.10 / ubuntu-24.04 py 3.10 latest PyQt5
  • GitHub Check: test_coverage / ubuntu-24.04 py 3.12 latest PyQt5
  • GitHub Check: 4DNucleome.PartSeg (Builds pyinstaller windows)
  • GitHub Check: 4DNucleome.PartSeg (Builds pyinstaller macos_arm)
  • GitHub Check: 4DNucleome.PartSeg (Builds sdist)
  • GitHub Check: 4DNucleome.PartSeg (Builds pyinstaller macos)
  • GitHub Check: 4DNucleome.PartSeg (Builds pyinstaller_linux)
  • GitHub Check: repo py3.12
  • GitHub Check: repo py3.11
  • GitHub Check: repo py3.10
  • GitHub Check: 4DNucleome.PartSeg (manifest_check manifest_check)
  • GitHub Check: 4DNucleome.PartSeg (Documentation_check Notebook_check)
  • GitHub Check: 4DNucleome.PartSeg (GetTestData linux)
  • GitHub Check: 4DNucleome.PartSeg (formatting_check check_formating)
  • GitHub Check: 4DNucleome.PartSeg (Documentation_check help)
  • GitHub Check: Codacy Static Code Analysis

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
pyproject.toml (1)

164-164: Removal of [tool.setuptools].license-files is fine if build backend supports [project].license-files

This cleanup is correct when targeting modern metadata, but it relies on a sufficiently new setuptools during builds (PEP 639 support). If your CI or downstream packagers may use older build environments, consider bumping [build-system].requires to a version that explicitly supports project.license-files, or keep the old key until all builders are updated.

If you choose to bump, update:

[build-system]
requires = ["setuptools>=<MIN_VERSION_SUPPORTING_PROJECT_LICENSE_FILES>", "setuptools_scm[toml]>=8"]

Confirm the minimal version from the previous web query and update accordingly.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 129a7e5 and cd18967.

📒 Files selected for processing (1)
  • pyproject.toml (2 hunks)
⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (19)
  • GitHub Check: 4DNucleome.PartSeg (Tests_other test windows)
  • GitHub Check: 4DNucleome.PartSeg (Tests_other test macos)
  • GitHub Check: 4DNucleome.PartSeg (Tests_linux test_linux)
  • GitHub Check: 4DNucleome.PartSeg (Builds pyinstaller windows)
  • GitHub Check: 4DNucleome.PartSeg (Builds pyinstaller macos_arm)
  • GitHub Check: 4DNucleome.PartSeg (Builds pyinstaller macos)
  • GitHub Check: 4DNucleome.PartSeg (Builds sdist)
  • GitHub Check: 4DNucleome.PartSeg (Builds pyinstaller_linux)
  • GitHub Check: repo py3.11
  • GitHub Check: repo py3.12
  • GitHub Check: windows-2022 py3.12 --pre
  • GitHub Check: macos-14 py3.12 --pre
  • GitHub Check: Base py3.11 / macos-15-intel py 3.11 latest PyQt5
  • GitHub Check: 4DNucleome.PartSeg (formatting_check check_formating)
  • GitHub Check: 4DNucleome.PartSeg (Documentation_check Notebook_check)
  • GitHub Check: 4DNucleome.PartSeg (Documentation_check help)
  • GitHub Check: 4DNucleome.PartSeg (GetTestData linux)
  • GitHub Check: 4DNucleome.PartSeg (manifest_check manifest_check)
  • GitHub Check: Codacy Static Code Analysis

Comment on lines +35 to +38
license = "BSD-3-Clause"
license-files = [
"License.txt",
]
Copy link
Contributor

@coderabbitai coderabbitai bot Oct 10, 2025

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Use PEP 621‑compliant license table (or bump build backend for PEP 639); keep license classifier for compatibility

  • PEP 621 expects license as a table ({file=...} or {text=...}); a plain string SPDX expression generally requires newer tooling (PEP 639 support). To be safe across builders, prefer the file form and keep license-files.
  • Also keep the Trove classifier (e.g., “License :: OSI Approved :: BSD License”) for discoverability and older consumers.

Suggested change within these lines:

-license = "BSD-3-Clause"
-license-files = [
-    "License.txt",
-]
+license = { file = "License.txt" }
+license-files = ["License.txt"]

Additionally (outside these lines):

  • Re‑add a license classifier under [project].classifiers:
    • "License :: OSI Approved :: BSD License"

To ensure the chosen approach is supported in your build pipeline:

Also verify the file exists with correct casing:


🏁 Script executed:

#!/bin/bash
# Expect to find the license file exactly as referenced
fd -a -i --strip-cwd-prefix --max-depth 2 'license*' | sed 's|^\./||'

Length of output: 30


🌐 Web query:

Which setuptools versions support:
1) PEP 621 `project.license` as an SPDX string (PEP 639 license expression)?
2) `project.license-files` in pyproject.toml?

💡 Result:

Short answer

  • Both PEP 639 SPDX license expressions in project.license and the project.license-files key in pyproject.toml were added in setuptools 77.0.0. [1][2]

Sources

  • setuptools documentation (notes that support for project.license-files and SPDX expressions was introduced in 77.0.0). [1]
  • PEP 639 (describes SPDX/License-File metadata expected by tooling). [2]
  • Related issue/discussion confirming behavior and the deprecation messaging around older table form. [3]

Bump setuptools to ≥77.0.0, use PEP 621 file-form license and re-add classifier

  • Replace:
-license = "BSD-3-Clause"
-license-files = [
-    "License.txt",
-]
+license = { file = "License.txt" }
+license-files = ["License.txt"]
  • Under [project].classifiers add:
    • "License :: OSI Approved :: BSD License"
  • In [build-system].requires, ensure setuptools>=77.0.0 to support PEP 639 license expressions and license-files.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
license = "BSD-3-Clause"
license-files = [
"License.txt",
]
license = { file = "License.txt" }
license-files = ["License.txt"]
🤖 Prompt for AI Agents
In pyproject.toml around lines 35 to 38, replace the current license stanza with
a PEP 621 file-form license and update build-system requirement: set the project
license to use the file form (e.g. license = { file = "License.txt" }) and add
the classifier "License :: OSI Approved :: BSD License" under
[project].classifiers; then ensure [build-system].requires includes
setuptools>=77.0.0 so the PEP 639 license expressions/license-files are
supported.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These changes are to resolve these warnings:

adding license file 'License.txt'
writing manifest file 'package/PartSeg.egg-info/SOURCES.txt'
/home/czaki/.cache/uv/builds-v0/.tmpPch8eG/lib/python3.11/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)
/home/czaki/.cache/uv/builds-v0/.tmpPch8eG/lib/python3.11/site-packages/setuptools/config/_apply_pyprojecttoml.py:55: SetuptoolsDeprecationWarning: 'tool.setuptools.license-files' is deprecated in favor of 'project.license-files' (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-files for details.
        ********************************************************************************

!!
  _apply_tool_table(dist, config, filename)
/home/czaki/.cache/uv/builds-v0/.tmpPch8eG/lib/python3.11/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()
/home/czaki/.cache/uv/builds-v0/.tmpPch8eG/lib/python3.11/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()

Copy link
Contributor

Choose a reason for hiding this comment

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

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check the current setuptools version requirement
grep -A2 "\[build-system\]" pyproject.toml | grep "requires"

Length of output: 87


@Czaki, you're absolutely right, and I apologize for my incorrect suggestion. Your implementation correctly addresses all the setuptools deprecation warnings:

Your changes are correct:

  1. Using license = "BSD-3-Clause" (SPDX string) instead of the table form
  2. Using project.license-files instead of tool.setuptools.license-files
  3. Removing the license classifier as recommended

The only remaining action to fully align with the warnings is to bump the setuptools version requirement, since the warnings state these features are "available on setuptools>=77.0.0":

[build-system]
requires = ["setuptools>=77.0.0", "setuptools_scm[toml]>=8"]

This ensures that all consumers of your package have the necessary setuptools version to properly handle the modern license metadata format.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated setuptools constraints

Copy link
Contributor

Choose a reason for hiding this comment

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

@Czaki, perfect! 🎉 With the setuptools requirement bumped to >=77.0.0, your changes now fully address all the deprecation warnings. The license metadata is correctly configured using modern PEP 621/PEP 639 standards:

license = "BSD-3-Clause" (SPDX expression)
license-files = ["License.txt"] under [project]
✅ Removed deprecated license classifier
setuptools>=77.0.0 in build requirements

All the deprecation warnings you mentioned should now be resolved!


If you found this review helpful, would you consider giving us a shout-out on X?

Thank you for using CodeRabbit!

@sonarqubecloud
Copy link

@Czaki Czaki merged commit 11c3869 into develop Oct 13, 2025
66 checks passed
@Czaki Czaki deleted the fix_licensing_meta branch October 13, 2025 15:42
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

Comments