Skip to content

build: name the CPython licence Python-2.0 so nuget.org accepts it - #2756

Merged
antonsynd merged 2 commits into
devfrom
claude/nuget-python-license
Nov 19, 2026
Merged

antonsynd merged 2 commits into
devfrom
claude/nuget-python-license

Conversation

@antonsynd

@antonsynd antonsynd commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

The v0.25.0 release's Push to NuGet job failed with HTTP 400 on SharpyLang.Core:

License expression must only contain licenses that are approved by Open Source Initiative or Free Software Foundation. Unsupported licenses: PSF-2.0.

Only SharpyLang.Compiler 0.25.0 reached nuget.org. Core, Stdlib and sharpyc all carry (Apache-2.0 OR MIT) AND PSF-2.0, set in 07db8ee (ruling on #2602), and none of them were pushed.

Owner ruling 2026-11-19: use Python-2.0, the OSI-approved SPDX id for the CPython licence, and cut 0.25.1.

  • src/Sharpy.{Core,Stdlib,Cli}/*.csproj: the licence expression is now (Apache-2.0 OR MIT) AND Python-2.0, and the comment above it names the CPython licence by that id.
  • build_tools/tests/test_package_licenses.py: covers every *.csproj, *.props and *.targets outside build output.
    • Every <PackageLicenseExpression> may name only ids in an accepted set (Apache-2.0, MIT, Python-2.0, each checked against SPDX's OSI/FSF flags).
    • A <PackageLicenseFile> fails, because it would bypass the check.
    • A positive control checks that the four packaged expressions are found.
    • This runs nuget.org's release-time check on every PR.

Mutation record:

  • Core set back to PSF-2.0 → test_every_licence_id_is_one_nuget_accepts red.
  • An attributed PSF-2.0 expression in a benchmarks/ .props → the same test red.
  • A PackageLicenseFile in a .targets → test_no_project_licenses_by_file red.
  • Each restored → 4 passed.

Packing Core in Release raises no NU5124/NU5125 warnings, and the nuspec reads <license type="expression">(Apache-2.0 OR MIT) AND Python-2.0</license>.

Independent review @ 424f0ac: merge; 3 applied, 1 declined (reasons below); fixes 424f0ac..b155bf8 read by the lead

Review findings (fresh code-reviewer agent, given the diff and the failure, not this PR's conclusions):

  1. Low, applied: the regex missed an attributed element (Condition=). It now admits attributes.
  2. Low, applied: the scan covered only src/ and Directory.Build.props. It now covers every project file outside build output, and a PackageLicenseFile fails.
  3. Nit, applied: the csproj comments said "the PSF licence"; they now name SPDX Python-2.0.
  4. Nit, declined: the accepted set is hand-maintained. It fails closed, so an unlisted id is refused rather than passed, and its comment says to check SPDX before adding one.

The 0.25.1 bump follows in #2757.

Issues closed: none. Filed: none. Refs #2602.

https://claude.ai/code/session_01LGMKZYfGwj3H3WNmGpXFFS


Generated by Claude Code

The v0.25.0 release's NuGet push stopped at SharpyLang.Core with HTTP 400:
nuget.org refuses a licence expression naming an SPDX id that is not
OSI-approved or FSF-free, and PSF-2.0 is not. Stdlib and sharpyc carried
the same expression and were never pushed. Owner ruling 2026-11-19: use
Python-2.0, the OSI-approved SPDX id for the CPython licence. Core, Stdlib
and Cli now read (Apache-2.0 OR MIT) AND Python-2.0. Refs #2602.

build_tools/tests/test_package_licenses.py runs the server's check on
every change: every <PackageLicenseExpression> under src/ and in
Directory.Build.props names only ids in the accepted set, with a
positive control that the four packaged expressions are found.

Mutation: Core back to PSF-2.0 -> test_every_licence_id_is_one_nuget_accepts
red (names ['PSF-2.0']); restored -> 3 passed. Packing Core (Release,
serialized wrapper): no NU5124/NU5125; the nuspec license expression is
(Apache-2.0 OR MIT) AND Python-2.0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LGMKZYfGwj3H3WNmGpXFFS
Independent review of 424f0ac (merge; two low findings, one nit):
- the expression regex now admits attributes (Condition=...);
- the scan covers every *.csproj, *.props and *.targets outside
  bin/obj/node_modules/.git/.venv, not only src/ and Directory.Build.props;
- a <PackageLicenseFile> anywhere fails, since it bypasses the check;
- the three csproj comments name the CPython licence (SPDX Python-2.0).

Mutations: a benchmarks/ .props with an attributed PSF-2.0 expression ->
test_every_licence_id_is_one_nuget_accepts red; a .targets setting
PackageLicenseFile -> test_no_project_licenses_by_file red; both removed
-> 4 passed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LGMKZYfGwj3H3WNmGpXFFS
@antonsynd
antonsynd merged commit 7c104af into dev Nov 19, 2026
35 of 36 checks passed
@antonsynd
antonsynd deleted the claude/nuget-python-license branch November 19, 2026 19:36
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.

2 participants