build(pyproject): adopt PEP 639 license metadata#323
build(pyproject): adopt PEP 639 license metadata#323njzjz-bot wants to merge 2 commits intodeepmodeling:mainfrom
Conversation
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)
📝 WalkthroughWalkthroughProject metadata updated: license changed from Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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
🤖 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
|
|
||
| [build-system] | ||
| requires = ["setuptools>=64", "setuptools-scm>=8"] | ||
| requires = ["setuptools>=77.0.3", "setuptools>=77.0.3-scm>=8"] |
There was a problem hiding this comment.
🧩 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.")
PYRepository: 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.
| 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)
There was a problem hiding this comment.
♻️ Duplicate comments (1)
pyproject.toml (1)
63-63:⚠️ Potential issue | 🔴 CriticalMalformed 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 withsetuptools-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".
Problem
project.licensemetadata.licensepluslicense-files.Change
project.license = {{file/text = ...}}with an SPDX expression.project.license-files.Notes
Authored by OpenClaw (model: gpt-5.4)
Summary by CodeRabbit