Replace bash dev script with justfile for task automation#679
Open
alexluck-sift wants to merge 7 commits into
Open
Replace bash dev script with justfile for task automation#679alexluck-sift wants to merge 7 commits into
alexluck-sift wants to merge 7 commits into
Conversation
Replace the hand-rolled python/scripts/dev bash dispatcher with a python/justfile that ports every subcommand 1:1 (all still run through uv). A fmt-check recipe is added for CI's non-writing format check. Rewire the callers so local, hook, and CI runs execute identical recipes: the pre-push-python hook scripts and the python_ci.yaml static-checks and test-python jobs now call just, with a setup-just step added to the jobs that need it. Remove scripts/dev and update the one doc reference to it. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
|
Python docs preview: https://sift-stack.github.io/sift/python/pr-679/ Deployed from |
Extend the just migration from python/ to the whole repo: - Add a root justfile that ports every makefile target (gen, git-hooks, serve/build-cli-docs) and exposes the Python tasks as a module, so `just python::test` etc. work from the repo root. The gen recipe still calls scripts/gen.sh; that script is an implementation, not a dispatcher, so it is unchanged. - Move the git-hook logic into just recipes: pre-commit (buf lint/format) and pre-push (per-language checks) live in the root justfile, and the per-check logic lives in the python module (fmt-lint-check, stubs-check, extras-check, lock-check) and a bindings-stubs-check recipe. The .githooks/pre-commit and pre-push files are now thin shims that exec just; the pre-push-python/*.sh and pre-push-rust/*.sh scripts are removed. - Point the two python_ci.yaml steps that ran the hook scripts at the equivalent just recipes. - Remove the makefile. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Replace the custom .githooks scripts with the pre-commit framework (.pre-commit-config.yaml), installed via `just install-hooks`. - commit stage: file hygiene (pre-commit-hooks), ruff lint+format, and buf lint/format for protos. - push stage: the full `just python::check` gate plus the sync-stub, extras, uv.lock, and rust-binding-stub checks. Python/rust tooling runs through the existing just recipes (which invoke uv/cargo in the right directory) so hooks use the versions pinned in the project env and the monorepo layout is handled. Remove the .githooks files and the now-superseded pre-commit/pre-push/git-hooks just recipes and python::fmt-lint-check. Add pre-commit to the dev extra, gated to Python 3.9+ (pre-commit 4.x drops 3.8), and regenerate the lock. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Bring the non-Python languages under the same just/pre-commit umbrella. - Add rust/justfile (fmt, fmt-check, check, clippy, test, and the relocated bindings-stubs-check) and go/justfile (fmt, fmt-check, mod-verify, build, vet, staticcheck, lint, test), mirroring the rust_ci and go_ci commands. Expose them from the root justfile as the `rust` and `go` modules (`just rust::test`, `just go::vet`, ...). - Add fast commit-stage pre-commit hooks: `cargo fmt --check` scoped to rust/ and `gofmt` scoped to go/. Heavier checks (clippy, vet, staticcheck, tests) stay in CI. - Move bindings-stubs-check from the root justfile into the rust module and update the pre-commit entry accordingly. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
wei-qlu
reviewed
Jul 14, 2026
Drop `always_run: true` from the python-check hook. It overrode the `files: ^python/` filter, so `just python::check` (mypy/pyright over the whole tree) ran on every push, including pushes that touch only rust/go/protos. The filter alone gates it correctly, matching the sibling push-stage hooks. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
wei-qlu
reviewed
Jul 17, 2026
`just check` ran the tools via `uv run` but never synced the dev-all extra, so after a plain `uv sync` (which prunes extras) it and the pre-push hook failed with command-not-found. Add a `_sync-dev` step as check's first dependency, matching stubs-check/extras-check which already `uv sync --extra dev-all`. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
wei-qlu
previously approved these changes
Jul 17, 2026
Swap the four cargo run steps (check, clippy, fmt --check, test) for the matching just rust:: recipes and add a setup-just step, so CI runs the same commands developers run locally and there's a single definition of each. The toolchain and mdbook install actions are unchanged (just wraps the commands, it doesn't install cargo). The bespoke sift_stream_bindings maturin lint/test step is left as-is; no recipe mirrors it. Co-Authored-By: Claude Opus 4.8 <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.
Summary
Migrate from a custom bash script (
scripts/dev) to ajustfilefor development task automation. This provides a more maintainable and discoverable way to run common development tasks.Key Changes
python/scripts/devbash script (251 lines) containing all development task definitionspython/justfilewith equivalent recipes for all development tasks, including:bootstrap,pip-installfmt,fmt-check,lint,lint-fix,mypy,mypy-win,pyright,checktest,test-floor,test-ceiling,test-pytest-compat,test-integration,test-allgen-stubs,mypy-stubs,gen-extrasdocs,docs-build.github/workflows/python_ci.yaml) to usejustcommands instead ofuv rundirectlyjustrecipes instead ofbash ./scripts/devjustcommandsNotable Implementation Details
justsetup step in CI workflow viaextractions/setup-just@v4fmt-checkrecipe for CI-specific format checking (non-destructive)test-pytest-compatusing bash script blocksdefaultrecipe that lists all available tasksjustrecipes rather than rawuv runcalls