FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Decouple js/package.json version from setuptools-scm by rtibbles · Pull Request #234 · learningequality/le-utils · GitHub

Decouple js/package.json version from setuptools-scm - #234

Merged
rtibbles merged 1 commit into
mainfrom
decouple-npm-version
Aug 4, 2026
Merged

Decouple js/package.json version from setuptools-scm#234
rtibbles merged 1 commit into
mainfrom
decouple-npm-version

Conversation

rtibbles commented Aug 3, 2026

Copy link
Copy Markdown
Member

Summary

Using setuptools-scm means that the version is now dynamic based on the most recent git tag
This broke linting because it would regenerate the npm package version
Fix this by no longer regenerating the npm version except at publish
The committed version is pinned to 0.0.0 - publishing generates and pushes the actual version

References

First seen: #230 — linting has failed on every PR opened since v0.2.18 was tagged.
Prior workaround: c4cdf70.

Reviewer guidance

  • scripts/set_npm_version.py:29 — the guard rejects anything that isn't a bare X.Y.Z; check that npm-publish.yml's checkout of the release ref actually yields one, or publishing fails closed.
  • Makefile:36 — only release-npm sets the version; confirm nothing in the PyPI path (dist/release) or downstream tooling reads the tracked value.
  • js/package.json:30 — the tracked placeholder is what a git install (npm install github:learningequality/le-utils) reports; confirm no consumer installs from git rather than the registry.

AI usage

Used Claude Code to diagnose the lint failure from the CI logs and write the fix, including splitting the version write into its own script rather than adding a flag to the spec generator. Verified with prek over all files (both normally and under a simulated post-release tag), the test suite, and manual exercise of the version guard.

`make build` regenerated the version from git tags, so the tracked value
could never match what setuptools-scm computes once a release tag exists:
the tag lands on a commit whose package.json predates it. Every commit
after a release failed `prek run --all-files` — after v0.2.18 the
rebuild-from-specs hook rewrote 0.2.18 to 0.2.19 and reported a diff.

Version writing moves to scripts/set_npm_version.py, run only by
`make release-npm`; the tracked value is a 0.0.0 placeholder. It now
rejects non-release versions instead of truncating them to X.Y.Z, so a
publish from an untagged checkout can't ship a version that corresponds
to no release.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014BmsXSofh7NSy7MTVgXa6P
rtibbles marked this pull request as ready for review August 4, 2026 04:26
rtibbles merged commit a8b9dcd into main Aug 4, 2026
21 checks passed
rtibbles deleted the decouple-npm-version branch August 4, 2026 04:26
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant


Back | FazBrowse Home | New Git URL