chore: update licensing metadata to follow modern standards#1314
chore: update licensing metadata to follow modern standards#1314
Conversation
WalkthroughUpdated pyproject.toml to change licensing and build metadata: added Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ 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)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
pyproject.toml (1)
164-164: Removal of[tool.setuptools].license-filesis fine if build backend supports[project].license-filesThis 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].requiresto a version that explicitly supportsproject.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
📒 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
| license = "BSD-3-Clause" | ||
| license-files = [ | ||
| "License.txt", | ||
| ] |
There was a problem hiding this comment.
🧩 Analysis chain
Use PEP 621‑compliant license table (or bump build backend for PEP 639); keep license classifier for compatibility
- PEP 621 expects
licenseas 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 keeplicense-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].classifiersadd:- "License :: OSI Approved :: BSD License"
- In
[build-system].requires, ensuresetuptools>=77.0.0to support PEP 639 license expressions andlicense-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.
| 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.
There was a problem hiding this comment.
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()
There was a problem hiding this comment.
🧩 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:
- Using
license = "BSD-3-Clause"(SPDX string) instead of the table form - Using
project.license-filesinstead oftool.setuptools.license-files - 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.
There was a problem hiding this comment.
Updated setuptools constraints
There was a problem hiding this comment.
@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!
|



Resolve warnings:
Summary by CodeRabbit
Documentation
Chores