Skip to content

Migrate python-distribution-parser into distribution/ (#18630) - #2

Merged
jonyoder merged 5 commits into
mainfrom
migrate-distribution
Jul 8, 2026
Merged

jonyoder merged 5 commits into
mainfrom
migrate-distribution

Conversation

@jonyoder

@jonyoder jonyoder commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Copy-fresh migration per RFD 0001 Phase 0. Ports rstudio/python-distribution-parser into distribution/ (source repo stays live, linked from README/NOTICE; not archived yet, gated on #18634).

Commits:

  1. Copy tree, rename root package parse -> distribution, rewrite all imports (incl the two test-file self-imports), SPDX headers, merge deps (cupaloy/go-cmp/samber-lo/x-crypto/x-text; vendor dropped).
  2. Fix 5 pre-existing golangci-lint findings (gofmt, 3x ST1005, QF1003).
  3. Gate the live TestParse behind the distribution_integration build tag + t.Skip when tools absent (needs python/rust/gpg/twine + network); rewrite cupaloy golden type prefixes after the package rename; prune 4 orphaned matplotlib snapshots; add doc.go.
  4. Attribution (NOTICE + README link).
  5. Fix a pre-existing archiver bug surfaced by RoboRev: ReadFile skipped the first tar entry (PKG-INFO-first sdists failed to parse), with an in-memory-tar regression test.

Note: 'Distribution' interface stays under internal/ (minimal surface); Requires-Dist stays []string per RFD. CI coverage for distribution/ is limited until the fast-follow fixture issue lands (the live parse test is gated).

Closes #18630.

jonyoder added 5 commits July 7, 2026 19:53
… rewrite imports (#18630)

Fresh copy (no history graft) from rstudio/python-distribution-parser; root
package parse -> distribution; internal/ nesting preserved. Builds and vets.
Lint fixes and test gating follow.
…snapshot prefixes (#18630)

TestParse needs python/rust/gpg/twine + network; tag it distribution_integration
and skip when tools absent, keeping default CI pure-Go. Rewrite cupaloy golden
type headers parse_test.->distribution_test. after the package rename; prune 4
orphaned matplotlib snapshots. Fast-follow: committed-fixture replay coverage.
tarReadCheck consumed the first header from the shared tar.Reader, so ReadFile
started at the second entry and missed an sdist whose PKG-INFO is the first tar
member. Copied verbatim from upstream. ReadFile now uses a fresh reader; adds an
in-memory-tar regression test. Surfaced by RoboRev.
@jonyoder
jonyoder merged commit 413166a into main Jul 8, 2026
2 checks passed
@jonyoder
jonyoder deleted the migrate-distribution branch July 8, 2026 14:28
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