diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5121f0d..e4315fd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 diff --git a/pyproject.toml b/pyproject.toml index eb32429..d73859c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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]