fix(release): build SPA in CI instead of committing dist (fixes PyPI 400) - #7
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
v1.0.7b2PyPI 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 differsfrom the committed bundle, so the runner's tree became dirty →
setuptools_scmproduceda dev/local version (
1.0.7b3.dev0+g….d20260616) → PyPI rejects the+localsegment.Fix
Stop tracking
dist/(gitignore it). CI's existingnpm run buildstep now produces anuntracked bundle that the wheel still includes via
package-data, so the tree staysclean and the version matches the tag.
.gitignore: drop the negations that force-trackedgui/webapp/dist.git rm --cachedthe 3 committed bundle files (kept on disk).release.ymlchange needed — it already builds the SPA before the wheel.Verified locally
gui/webapp/dist/*+monitor/*(package-data globs the filesystem).npm run build,git statusis clean (dist ignored) → CI rebuild won't dirty thetree → clean tag version.
Trade-off: installing from a raw git checkout (not PyPI) needs
npm run buildonce; PyPIusers get the prebuilt SPA in the wheel.
Follow-up: cut
v1.0.7b3after merge (the failedv1.0.7b2tag will be removed).🤖 Generated with Claude Code