8000 fix(packaging): keep node_modules out of the sdist by dmux · Pull Request #6 · dmux/minilake · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,21 @@ jobs:
fi
echo "Web UI present: $count files."

# PyPI rejects any file over 100 MB, and it does so *after* the wheel has
# already been uploaded — leaving a half-published release that cannot be
# replaced. The sdist is the one that grows: hatchling honours only the root
# .gitignore, so anything ui/.gitignore covers (node_modules above all) has to
# be excluded explicitly in pyproject.toml.
- name: Verify the sdist is within PyPI's size limit
run: |
bytes=$(stat -c%s dist/*.tar.gz)
mb=$((bytes / 1024 / 1024))
if [ "$mb" -ge 95 ]; then
echo "::error::The sdist is ${mb} MB; PyPI's limit is 100 MB. Check what leaked into it: tar tzf dist/*.tar.gz | awk -F/ '{print \$2\"/\"\$3}' | sort | uniq -c | sort -rn | head"
exit 1
fi
echo "sdist is ${mb} MB."

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

Expand Down
9 changes: 9 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,15 @@ exclude = [
"/htmlcov",
"/data",
"/scratchpad",
# hatchling only honours the *root* .gitignore, so everything ui/.gitignore
# covers has to be repeated here. Without this the sdist carries ui/node_modules
# — 44k files, 300+ MB — because the release workflow runs `pnpm install` before
# `uv build`. PyPI rejects anything over 100 MB, and the failure lands after the
# wheel has already been uploaded.
"/ui/node_modules",
"/ui/.next",
"/ui/out",
"/ui/public/monaco",
]

[tool.pytest.ini_options]
Expand Down
Loading
0