Skip to content

fix(release): build SPA in CI instead of committing dist (fixes PyPI 400) - #7

Merged
jia-xie merged 1 commit into
mainfrom
fix/release-dist-build
Jun 16, 2026
Merged

fix(release): build SPA in CI instead of committing dist (fixes PyPI 400)#7
jia-xie merged 1 commit into
mainfrom
fix/release-dist-build

Conversation

@jia-xie

@jia-xie jia-xie commented Jun 16, 2026

Copy link
Copy Markdown
Owner

Problem

The v1.0.7b2 PyPI publish failed (HTTP 400). Root cause: we committed the built SPA
(damiao_motor/gui/webapp/dist/) and rebuilt it in release CI. The CI rebuild differs
from the committed bundle, so the runner's tree became dirtysetuptools_scm produced
a dev/local version (1.0.7b3.dev0+g…​.d20260616) → PyPI rejects the +local segment.

Fix

Stop tracking dist/ (gitignore it). CI's existing npm run build step now produces an
untracked bundle that the wheel still includes via package-data, so the tree stays
clean and the version matches the tag.

  • .gitignore: drop the negations that force-tracked gui/webapp/dist.
  • git rm --cached the 3 committed bundle files (kept on disk).
  • No release.yml change needed — it already builds the SPA before the wheel.

Verified locally

  • Wheel still contains gui/webapp/dist/* + monitor/* (package-data globs the filesystem).
  • After npm run build, git status is clean (dist ignored) → CI rebuild won't dirty the
    tree → clean tag version.

Trade-off: installing from a raw git checkout (not PyPI) needs npm run build once; PyPI
users get the prebuilt SPA in the wheel.

Follow-up: cut v1.0.7b3 after merge (the failed v1.0.7b2 tag will be removed).

🤖 Generated with Claude Code

Committing damiao_motor/gui/webapp/dist AND rebuilding it in release CI made the runner's
working tree dirty -> setuptools_scm emitted a dev/local version (e.g. 1.0.7b3.dev0+g..d..)
-> PyPI rejected the '+local' segment (400). Stop tracking dist (gitignore it); CI's
'npm run build' now produces an UNTRACKED bundle that the wheel still includes via
package-data, so the tree stays clean and the version matches the tag.

Trade-off: installing from a raw git checkout (not PyPI) needs 'npm run build' once;
PyPI users get the prebuilt SPA in the wheel.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jia-xie
jia-xie merged commit 60bb17b into main Jun 16, 2026
1 check 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