Skip to content

fix(ci): strip release wheels and check PyPI size limits - #253

Merged
beinan merged 2 commits into
lance-format:mainfrom
beinan:codex/python-publish-size
Sep 17, 2026
Merged

beinan merged 2 commits into
lance-format:mainfrom
beinan:codex/python-publish-size

Conversation

@beinan

@beinan beinan commented Sep 14, 2026 •

Copy link
Copy Markdown
Collaborator

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 --strip on 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 --sdist build resolved new, incompatible aws-smithy-json/aws-smithy-types versions. 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 publish already skips identical files on PyPI; rebuilt files with the same name must not replace published content.

Testing

  • actionlint .github/workflows/python-publish.yml and git diff --check passed.
  • Executed the workflow's size-check script against valid wheels/source archives, the exact limit, a wheel one byte over, a source archive one byte over, an empty directory, and a missing directory. All behaved as expected.
  • Confirmed the check rejects the actual 107,285,721-byte ARM64 wheel from the failed release.
  • Confirmed both build commands strip symbols and the size check runs before publishing without a release-only condition.
  • Application checks on fcf5394 (application sources are unchanged by the lockfile cleanup): ./.codex/skills/ci-pr-helper/scripts/run_ci_checks.sh passed: 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.
  • With Maturin 1.15.0, confirmed the sdist contains the exact workspace Cargo.lock at its root. Cargo only prunes unused workspace dependencies; all 1,002 remaining package versions match the original lock, including aws-smithy-json 0.62.7 and aws-smithy-types 1.4.9.
  • maturin build --strip --sdist passed 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 both lance_context and its native extension successfully.
  • Ran the workflow size check against the actual ARM64/macOS release wheels and the corrected sdist; all passed.
  • Release builds and Python CI have been retriggered on 71d08f5.

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
@beinan
beinan merged commit e2a9de0 into lance-format:main Sep 17, 2026
9 checks passed
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