Skip to content

Replace bash dev script with justfile for task automation#679

Open
alexluck-sift wants to merge 7 commits into
mainfrom
claude/al/python/feat/just-and-setuptools-scm
Open

Replace bash dev script with justfile for task automation#679
alexluck-sift wants to merge 7 commits into
mainfrom
claude/al/python/feat/just-and-setuptools-scm

Conversation

@alexluck-sift

@alexluck-sift alexluck-sift commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

Migrate from a custom bash script (scripts/dev) to a justfile for development task automation. This provides a more maintainable and discoverable way to run common development tasks.

Key Changes

  • Removed python/scripts/dev bash script (251 lines) containing all development task definitions
  • Added python/justfile with equivalent recipes for all development tasks, including:
    • Environment setup: bootstrap, pip-install
    • Code quality: fmt, fmt-check, lint, lint-fix, mypy, mypy-win, pyright, check
    • Testing: test, test-floor, test-ceiling, test-pytest-compat, test-integration, test-all
    • Code generation: gen-stubs, mypy-stubs, gen-extras
    • Documentation: docs, docs-build
  • Updated CI workflow (.github/workflows/python_ci.yaml) to use just commands instead of uv run directly
  • Updated pre-push git hooks to invoke just recipes instead of bash ./scripts/dev
  • Updated documentation references in test README to point to just commands

Notable Implementation Details

  • Added just setup step in CI workflow via extractions/setup-just@v4
  • Preserved all original functionality and command behavior
  • Added fmt-check recipe for CI-specific format checking (non-destructive)
  • Maintained complex multi-step recipes like test-pytest-compat using bash script blocks
  • Improved discoverability with default recipe that lists all available tasks
  • Simplified CI commands by delegating to just recipes rather than raw uv run calls

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>
@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Python docs preview: https://sift-stack.github.io/sift/python/pr-679/

Deployed from a397914. The link may take up to a minute to become live as GitHub Pages propagates.

claude added 3 commits July 10, 2026 23:35
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>
@alexluck-sift
alexluck-sift requested a review from wei-qlu July 14, 2026 16:53
Comment thread .pre-commit-config.yaml Outdated
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>
@alexluck-sift
alexluck-sift requested a review from wei-qlu July 17, 2026 16:05
Comment thread python/justfile Outdated
`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>
@alexluck-sift
alexluck-sift requested a review from wei-qlu July 17, 2026 20:21
wei-qlu
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>
@alexluck-sift
alexluck-sift requested a review from wei-qlu July 20, 2026 15:39
@alexluck-sift
alexluck-sift marked this pull request as ready for review July 20, 2026 15:40
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.

3 participants