Skip to content

Bundle Go dependency license files - #36

Merged
timkpaine merged 1 commit into
mainfrom
go-license-bundles
Oct 15, 2026
Merged

timkpaine merged 1 commit into
mainfrom
go-license-bundles

Conversation

@timkpaine

Copy link
Copy Markdown
Member

Description

Add opt-in Go dependency license bundles using go-licenses save .. CI installs the tested collector, google/go-licenses v2.0.1; users install it separately.

  • Configure licenses.destination as a wheel-relative directory. Preserve every original saved license, notice, and source artifact in standard and editable wheels; keep temporary output out of source distributions.
  • Match the build's target, CGO configuration, effective GOFLAGS, and explicit package-selection flags. Reject shell-dependent flags and disable external package drivers for collection.
  • Fail on missing or unknown licenses, collector errors, empty license texts, symlinks, unsafe paths, destination collisions, and Hatch source rewrites.
  • Document collection limits and review requirements. Some classifications save whole source directories, potentially including unrelated local files. Standard-library/runtime licenses and dependencies hidden in C/C++, assembly, or system libraries need separate review.

Verified on macOS arm64 with Python 3.12.14 and Go 1.27.1: 87 source tests and all 87 tests from the installed plugin wheel, 95.25% coverage, lint, type checks, manifest checks, wheel/sdist builds, and Twine checks. Tests cover real direct/transitive and build-tag-selected dependencies, persisted Go configuration, CRLF notices, full reciprocal-license source trees, native imports, standard/editable wheels, and sdist-to-wheel builds.

Runtime dependencies and version remain unchanged. editables is added only to the development extra for Hatchling's editable-wheel tests. No release is included.

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Refactor / code cleanup
  • CI / build configuration
  • Other (describe below)

Checklist

  • Linting passes (make lint)
  • Tests pass (make test; run through make coverage)
  • New tests added for new functionality
  • Documentation updated (if applicable)
  • Changelog / version bump (if applicable; not requested)

Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

Test Results

87 tests  +62   87 ✅ +62   42s ⏱️ +33s
 1 suites ± 0    0 💤 ± 0 
 1 files   ± 0    0 ❌ ± 0 

Results for commit d3629f8. ± Comparison against base commit 280a888.

@codecov

codecov Bot commented Oct 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.05376% with 23 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.24%. Comparing base (280a888) to head (d3629f8).

Files with missing lines Patch % Lines
hatch_go/plugin.py 78.26% 15 Missing ⚠️
hatch_go/licenses.py 89.61% 8 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main      #36       +/-   ##
===========================================
+ Coverage   78.14%   95.24%   +17.10%     
===========================================
  Files           8       12        +4     
  Lines         421      884      +463     
===========================================
+ Hits          329      842      +513     
+ Misses         92       42       -50     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@timkpaine
timkpaine marked this pull request as ready for review October 15, 2026 19:49
@timkpaine
timkpaine merged commit 2882a6d into main Oct 15, 2026
4 checks passed
@timkpaine
timkpaine deleted the go-license-bundles branch October 15, 2026 19:49
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