diff --git a/.gitignore b/.gitignore index bc3ad68..c41befc 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,6 @@ models/* # Agent-local settings (per-machine permission allowlists) .claude/settings.local.json + +# Package build output (make build) +/dist/ diff --git a/AGENTS.md b/AGENTS.md index e1b0d7b..000f58b 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -94,6 +94,7 @@ Always use the Makefile. `make help` lists every target; this is the full set: | `make check-sample` | Transcribe the AMI sample; print WER against `samples/ami/EN2002b-human.txt` (no gate); fail if any word differs from `samples/ami/EN2002b-reference.txt` | | `make test-fast` | pytest without the `slow` (real inference) tests | | `make test` | Whole suite; never touches `tmp/output` | +| `make build` | `python -m build` into `dist/`, as CI does | | `make lint` | `ruff check` and `ruff format --check` | | `make format` | `ruff format` | | `make typecheck` | `mypy --strict` | @@ -415,7 +416,7 @@ fails loudly. extend one that already covers it. Use synthetic fixtures where possible, and the slow whisper tests only when testing whisper behavior. 6. Run `make lint`, `make typecheck` and `make test` before declaring done. - `lefthook install` runs `make lint typecheck test-fast` before every push (`lefthook.yml`). + `lefthook install` runs `make lint typecheck test-fast build` before every push (`lefthook.yml`). ## Common Pitfalls diff --git a/Makefile b/Makefile index c029072..ee17f83 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ .PHONY: help check-deps setup install setup-whisper run run-single \ - combine-transcripts filter-vtt session-env compare-transcripts create-sample-files sample-ami check-sample test test-fast lint format typecheck lint-pyrefly \ + combine-transcripts filter-vtt session-env compare-transcripts create-sample-files sample-ami check-sample test test-fast build lint format typecheck lint-pyrefly \ clean-output clean-tmp ROOT_DIR := $(shell pwd) @@ -133,6 +133,9 @@ test: ## Run the whole suite, including real whisper/VAD inference test-fast: ## Run the suite without the slow inference tests $(VENV_CMD) python -m pytest tests/ -v -m "not slow" +build: ## Build the sdist and wheel into dist/, as CI does + $(VENV_CMD) python -m build + lint: ## Run ruff check and ruff format --check $(VENV_CMD) ruff check --output-format concise . && ruff format --check . diff --git a/docs/README.md b/docs/README.md index 2249a12..2e05a65 100644 --- a/docs/README.md +++ b/docs/README.md @@ -136,7 +136,8 @@ make check-sample # Transcribe the 4-speaker AMI sample; p make lint # ruff check and format check make format # ruff format make typecheck # mypy --strict -lefthook install # Run lint, typecheck and test-fast before every push +make build # sdist and wheel into dist/, as CI does +lefthook install # Run lint, typecheck, test-fast and build before every push make clean-output # Delete every session's outputs under tmp/output ``` diff --git a/lefthook.yml b/lefthook.yml index 21a91c0..b00f337 100644 --- a/lefthook.yml +++ b/lefthook.yml @@ -1,6 +1,6 @@ -# Runs what CI runs, minus the package build. Install once per clone: `lefthook install`. +# Runs what CI runs. Install once per clone: `lefthook install`. pre-push: jobs: - name: check # Git's repo variables break tools run from a linked worktree. - run: unset $(git rev-parse --local-env-vars); make lint typecheck test-fast + run: unset $(git rev-parse --local-env-vars); make lint typecheck test-fast build diff --git a/pyproject.toml b/pyproject.toml index 930a44a..700e32a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,6 +38,7 @@ classifiers = [ [project.optional-dependencies] dev = [ + "build==1.6.1", "mypy==2.4.0", "pyrefly==1.4.0", "pytest==9.1.1",