Skip to content

build(pyproject): adopt PEP 639 license metadata#323

Open
njzjz-bot wants to merge 2 commits intodeepmodeling:mainfrom
njzjz-bothub:openclaw/pep639-license
Open

build(pyproject): adopt PEP 639 license metadata#323
njzjz-bot wants to merge 2 commits intodeepmodeling:mainfrom
njzjz-bothub:openclaw/pep639-license

Conversation

@njzjz-bot
Copy link
Copy Markdown
Contributor

@njzjz-bot njzjz-bot commented Apr 6, 2026

Problem

  • Several packages still use deprecated table-based project.license metadata.
  • PEP 639 standardizes SPDX license plus license-files.

Change

  • Replace deprecated project.license = {{file/text = ...}} with an SPDX expression.
  • Add project.license-files.
  • Raise the setuptools minimum version to one that supports PEP 639 where needed.

Notes

  • This change is metadata-only and does not alter runtime behavior.

Authored by OpenClaw (model: gpt-5.4)

Summary by CodeRabbit

  • Chores
    • Updated project license to LGPL-3.0-or-later and included the LICENSE file in packaging.
    • Removed a legacy LGPL v3 classifier from metadata.
    • Raised build-system requirements to require newer setuptools versions.

Use SPDX license expressions and add license-files in pyproject.toml.
Update setuptools minimum version where needed so the backend supports
PEP 639 license metadata.

Authored by OpenClaw (model: gpt-5.4)
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 6, 2026

📝 Walkthrough

Walkthrough

Project metadata updated: license changed from LGPL-3.0 to LGPL-3.0-or-later, LICENSE declared via license-files, an LGPLv3 Trove classifier removed, and build-system setuptools requirement raised from >=64 to >=77.0.3 with an altered requires entry.

Changes

Cohort / File(s) Summary
Project Configuration
pyproject.toml
Changed license from {text = "LGPL-3.0"} to license = "LGPL-3.0-or-later" and added license-files = ["LICENSE"]. Removed Trove classifier for LGPLv3. Increased build-system setuptools minimum from >=64 to >=77.0.3. Note: build-system.requires now contains a likely malformed/ambiguous entry setuptools>=77.0.3-scm>=8 that should be verified.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 3
✅ 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 'adopt PEP 639 license metadata' accurately captures the main change: updating pyproject.toml to use PEP 639 license metadata format instead of deprecated inline tables.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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
Copy Markdown
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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@pyproject.toml`:
- Line 64: The requires entry in pyproject.toml currently has a malformed
requirement string ("setuptools>=77.0.3-scm>=8"); update the requires list so it
contains two valid PEP 508 requirement strings instead of the concatenated one —
replace the single "setuptools>=77.0.3-scm>=8" item with "setuptools>=77.0.3"
and "setuptools-scm>=8" in the requires array to fix metadata parsing and
installation.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: baf4215a-9350-4f15-9876-ea23a93273f1

📥 Commits

Reviewing files that changed from the base of the PR and between f00da65 and d5a61da.

📒 Files selected for processing (1)
  • pyproject.toml


[build-system]
requires = ["setuptools>=64", "setuptools-scm>=8"]
requires = ["setuptools>=77.0.3", "setuptools>=77.0.3-scm>=8"]
Copy link
Copy Markdown
Contributor

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

🏁 Script executed:

#!/bin/bash
# Verify [build-system].requires entries are syntactically sane and not conflated.
python - <<'PY'
import tomllib, re, sys
with open("pyproject.toml", "rb") as f:
    data = tomllib.load(f)

reqs = data.get("build-system", {}).get("requires", [])
print("build-system.requires =", reqs)

bad = [r for r in reqs if re.search(r"setuptools>=\d+(\.\d+)*-scm", r)]
if bad:
    print("INVALID combined requirement(s):", bad)
    sys.exit(1)

expected = {"setuptools>=77.0.3", "setuptools-scm>=8"}
missing = expected - set(reqs)
if missing:
    print("Missing expected requirement(s):", sorted(missing))
    sys.exit(2)

print("Requirements look correctly split.")
PY

Repository: deepmodeling/DeePTB

Length of output: 201


Fix malformed build requirement on Line 64.

"setuptools>=77.0.3-scm>=8" is invalid—it conflates two separate package requirements into one non-compliant string, causing TOML/packaging schema parse failures that block metadata generation and installation.

🔧 Proposed fix
requires = ["setuptools>=77.0.3", "setuptools>=77.0.3-scm>=8"]
requires = ["setuptools>=77.0.3", "setuptools-scm>=8"]

Split into two proper PEP 508 requirement strings: setuptools>=77.0.3 and setuptools-scm>=8.

📝 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
requires = ["setuptools>=77.0.3", "setuptools>=77.0.3-scm>=8"]
requires = ["setuptools>=77.0.3", "setuptools-scm>=8"]
🧰 Tools
🪛 GitHub Actions: DeePTB tests.

[error] 64-64: uv failed to generate package metadata for dptb @ editable+ because pyproject.toml does not match the required schema. TOML parse error at line 64, column 35: invalid version string in requires = ["setuptools>=77.0.3", "setuptools>=77.0.3-scm>=8"] (after parsing 77.0.3, found -scm>=8 which is not part of a valid version).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pyproject.toml` at line 64, The requires entry in pyproject.toml currently
has a malformed requirement string ("setuptools>=77.0.3-scm>=8"); update the
requires list so it contains two valid PEP 508 requirement strings instead of
the concatenated one — replace the single "setuptools>=77.0.3-scm>=8" item with
"setuptools>=77.0.3" and "setuptools-scm>=8" in the requires array to fix
metadata parsing and installation.

Setuptools rejects legacy License :: classifiers when a PEP 639
license expression is present. Remove the classifier and keep the
SPDX license metadata.

Authored by OpenClaw (model: gpt-5.4)
Copy link
Copy Markdown
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.

♻️ Duplicate comments (1)
pyproject.toml (1)

63-63: ⚠️ Potential issue | 🔴 Critical

Malformed build requirement still present on Line 63 (already reported).

Line 63 still includes setuptools>=77.0.3-scm>=8, which is not a valid requirement string and breaks metadata parsing. Replace it with setuptools-scm>=8.

🔧 Proposed fix
-requires = ["setuptools>=77.0.3", "setuptools>=77.0.3-scm>=8"]
+requires = ["setuptools>=77.0.3", "setuptools-scm>=8"]
#!/bin/bash
# Verify [build-system].requires are valid PEP 508 strings and specifically catch the malformed entry.
python - <<'PY'
import tomllib, sys
from packaging.requirements import Requirement

with open("pyproject.toml", "rb") as f:
    data = tomllib.load(f)

reqs = data.get("build-system", {}).get("requires", [])
print("build-system.requires =", reqs)

errors = []
for r in reqs:
    try:
        Requirement(r)
    except Exception as e:
        errors.append((r, str(e)))

if errors:
    print("\nInvalid requirement(s):")
    for r, e in errors:
        print(f"- {r} -> {e}")
    sys.exit(1)

expected = {"setuptools>=77.0.3", "setuptools-scm>=8"}
missing = expected - set(reqs)
if missing:
    print("\nMissing expected requirement(s):", sorted(missing))
    sys.exit(2)

print("\nAll requirements parse correctly.")
PY
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pyproject.toml` at line 63, The build-system requires list contains a
malformed entry "setuptools>=77.0.3-scm>=8"; replace that exact string in the
pyproject.toml requires array with the correct package name and version spec
"setuptools-scm>=8" and ensure the list still includes "setuptools>=77.0.3" so
the final requires contains "setuptools>=77.0.3" and "setuptools-scm>=8".
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@pyproject.toml`:
- Line 63: The build-system requires list contains a malformed entry
"setuptools>=77.0.3-scm>=8"; replace that exact string in the pyproject.toml
requires array with the correct package name and version spec
"setuptools-scm>=8" and ensure the list still includes "setuptools>=77.0.3" so
the final requires contains "setuptools>=77.0.3" and "setuptools-scm>=8".

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a94e0d3e-8733-490b-9c65-7a6332cd9641

📥 Commits

Reviewing files that changed from the base of the PR and between d5a61da and 020e80a.

📒 Files selected for processing (1)
  • pyproject.toml

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