From 1d7aef4feb8be7483abe87d590f89974daafaf46 Mon Sep 17 00:00:00 2001 From: Evan Follis Date: Sun, 26 Jul 2026 20:59:53 +0000 Subject: [PATCH] Make checks discover the local virtualenv --- Makefile | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 890a806..42da358 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,7 @@ .PHONY: help setup check test lint typecheck +PYTHON := $(shell test -x .venv/bin/python && printf '%s' .venv/bin/python || command -v python3) + help: @printf '%s\n' \ 'make setup Install the package and deterministic check dependencies' \ @@ -9,20 +11,21 @@ help: 'make typecheck Report the known mypy migration gap' setup: - python3 -m pip install -e ".[test]" + @test -x .venv/bin/python || python3 -m venv .venv + .venv/bin/python -m pip install -e ".[test]" check: - @python3 -c 'import pathlib,tomllib; r=pathlib.Path("."); d=tomllib.loads((r/"repo.toml").read_text()); assert d["schema_version"] == 1 and d["shape"] == "library"; [(_ for _ in ()).throw(AssertionError(f"missing {p}")) for p in ("README.md","repo.toml","Makefile","AGENTS.md","CLAUDE.md","docs/ARCHITECTURE.md") if not (r/p).exists()]' - python3 scripts/check_repo_hygiene.py - python3 -m ruff check src tests scripts - python3 -m pytest -q + @$(PYTHON) -c 'import pathlib,tomllib; r=pathlib.Path("."); d=tomllib.loads((r/"repo.toml").read_text()); assert d["schema_version"] == 1 and d["shape"] == "library"; [(_ for _ in ()).throw(AssertionError(f"missing {p}")) for p in ("README.md","repo.toml","Makefile","AGENTS.md","CLAUDE.md","docs/ARCHITECTURE.md") if not (r/p).exists()]' + $(PYTHON) scripts/check_repo_hygiene.py + $(PYTHON) -m ruff check src tests scripts + $(PYTHON) -m pytest -q git diff --check test: - python3 -m pytest -q + $(PYTHON) -m pytest -q lint: - python3 -m ruff check src tests scripts + $(PYTHON) -m ruff check src tests scripts typecheck: @printf '%s\n' 'mypy is not yet a gate: 31 pre-existing typing findings are tracked in docs/ARCHITECTURE.md.'