Skip to content

fix(packaging): keep node_modules out of the sdist - #6

Merged
dmux merged 1 commit into
mainfrom
fix/sdist-ships-node-modules
Aug 19, 2026
Merged

fix(packaging): keep node_modules out of the sdist#6
dmux merged 1 commit into
mainfrom
fix/sdist-ships-node-modules

Conversation

@dmux

@dmux dmux commented Aug 19, 2026

Copy link
Copy Markdown
Owner

Found by the v1.7.0 release failing halfway.

pypi-publish uploaded the wheel, then rejected the sdist:

INFO  dist/minilake-1.7.0.tar.gz (308.6 MB)
400 File too large. Limit for project 'minilake' is 100 MB.

Cause

hatchling honours only the root .gitignore. Everything ui/.gitignore covers — node_modules, .next, out, public/monaco — is invisible to it and lands in the sdist. The pypi-publish job runs pnpm install before uv build, so 44k files of node_modules went along.

It never bit before because 1.7.0 is the first release where the workflow builds a web UI, and so the first where node_modules exists at packaging time.

Changes

  • Explicit sdist excludes for the ui build and dependency directories. 350 MB → 7.0 MB; the wheel is unaffected (265 ui_static files, verified).
  • A workflow guard that fails the publish before uploading anything if the sdist exceeds the limit. The existing web-UI guard passed and did its job — this covers the other half.

State of v1.7.0

artifact status
PyPI wheel published, complete (UI + Monaco + notebook)
PyPI sdist missing
ghcr image 1.7.0/1.7/latest published
GitHub Release not created (job skipped after the failure)

hatchling honours only the root .gitignore, so everything ui/.gitignore
covers still lands in the sdist. The release workflow runs `pnpm install`
before `uv build`, so ui/node_modules — 44k files — went in with it: 350 MB
against PyPI's 100 MB per-file limit.

PyPI rejected it *after* the wheel had already uploaded, which is the worst
shape for this failure: v1.7.0 has a correct wheel, no sdist, and no GitHub
Release, and a PyPI upload cannot be replaced.

Excludes ui/node_modules, ui/.next, ui/out and ui/public/monaco from the
sdist (350 MB -> 7.0 MB), and adds a workflow guard that fails the publish
before anything is uploaded if the sdist ever grows past the limit again.
@dmux
dmux merged commit 8e997ce into main Aug 19, 2026
3 checks passed
@dmux
dmux deleted the fix/sdist-ships-node-modules branch August 19, 2026 02:13
@dmux dmux mentioned this pull request Aug 19, 2026
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