Repository navigation
fix(ci): strip release wheels and check PyPI size limits - #253
Merged
Merged
Conversation
beinan
pushed a commit
that referenced
this pull request
Sep 17, 2026
## Summary Fix the dependency-resolution failure in the x86_64 sdist build of #253 ([failed run](https://github.com/lance-format/lance-context/actions/runs/34906824509)), independently of its wheel-size fix. - Remove the obsolete `python/Cargo.lock`. Python is a member of the root workspace, but Maturin 1.15 prefers the nested lock when packaging. The resulting sdist contains `python/Cargo.lock` and no root lock, so Cargo resolves fresh dependencies from the extracted workspace. - Verify the sdist contains the exact workspace lock and no obsolete nested lock before uploading artifacts. Include packaging/lockfile changes in the PR workflow trigger. - Document why `--locked` is not a solution for the combined `--sdist` build: Maturin removes unused workspace members, requiring Cargo to prune their lock entries. The failed build selected `aws-smithy-types 1.7.0` with `aws-smithy-json 0.63.0` and failed with E0308/E0004. The repaired sdist retains the checked-in `1.4.9` / `0.62.7` versions. No dependency upgrades or runtime-code changes; most deleted lines are the unused generated lockfile. ## Validation - Reproduced the old archive with Maturin 1.15.0 and confirmed the workspace lock is missing. - Rebuilt the archive after removing the nested lock: packaged root lock matches the checked-in file byte-for-byte. - Ran Cargo metadata resolution offline from the extracted archive: no package versions added or upgraded; only unused workspace packages/features pruned. - Built a real macOS ARM64 native wheel from the repaired sdist with `maturin build --sdist --strip --offline` (debug profile). Imported that wheel and exercised Datagen append, item/root history and folded codec metadata. - Executed the exact workflow guard against six cases: valid, missing root lock, stale root lock, nested lock, empty directory and multiple source archives. Also checked the real before/after sdists. - Actionlint and `git diff --check` passed. No pre-commit configuration/hook is installed in this checkout. Linux release builds still need CI verification. This complements rather than replaces #253's stripping/size gate. No publishing was triggered, and the already-published v0.6.6 macOS artifact must not be replaced by the locally rebuilt wheel. 🤖 Generated with [MAI Agents](https://github.com/infinity-microsoft/mai-agents) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: a563b220-9ce6-4724-97e4-601ec8ffd89a
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The v0.6.6 Python publish failed after uploading the macOS wheel: the Linux ARM64 wheel was 102.3 MiB, above PyPI's 100 MiB per-file limit.
Build release wheels with
maturin --stripon Linux and macOS, and disable debug information in the publish workflow. The completed PR builds produced an 83.78 MiB Linux ARM64 wheel and a 76.57 MiB macOS wheel, both below the limit.Check every wheel and source distribution against the 104,857,600-byte limit before uploading any file. Print all sizes and reject oversized or missing distributions. This check also runs for PRs and manual dry runs.
Remove the stale
python/Cargo.lock. Maturin preferred that member lockfile and omitted the workspace-root lockfile from the sdist, so the x86_64--sdistbuild resolved new, incompatibleaws-smithy-json/aws-smithy-typesversions. The sdist now includes the actual workspace lockfile and retains its dependency versions.Recovery of the partially published v0.6.6 remains a separate release operation: retain the original, already published macOS wheel when uploading the missing distributions.
uv publishalready skips identical files on PyPI; rebuilt files with the same name must not replace published content.Testing
actionlint .github/workflows/python-publish.ymlandgit diff --checkpassed.fcf5394(application sources are unchanged by the lockfile cleanup):./.codex/skills/ci-pr-helper/scripts/run_ci_checks.shpassed: Rust formatting and Clippy; 397 Rust tests passed, 25 ignored; 220 Python tests passed, 11 skipped, 1 expected failure; Ruff formatting/lint and Pyright passed. Python tests used a local debug build; skips include the remote HTTP tests because this worktree has no server binary.Cargo.lockat its root. Cargo only prunes unused workspace dependencies; all 1,002 remaining package versions match the original lock, includingaws-smithy-json 0.62.7andaws-smithy-types 1.4.9.maturin build --strip --sdistpassed locally in the debug profile, including building the wheel from the extracted source archive. Installed that wheel in a fresh Python 3.12 environment and imported bothlance_contextand its native extension successfully.71d08f5.