1- .PHONY : install hooks lint format typecheck test coverage build verify-lock dist-check samples profile check check-all clean
1+ .PHONY : install hooks lint format typecheck test coverage build verify-lock dist-check samples samples-local profile check check-all clean
22
33install :
44 uv sync --all-extras
@@ -50,14 +50,32 @@ dist-check: build
5050 " import configdirector; print('wheel imports cleanly:', configdirector.__version__)" ; \
5151 status=$$? ; rm -rf " $$ tmp" ; exit $$ status
5252
53- # Samples resolve the SDK by local path, so this is what catches a breaking API change.
53+ # Samples resolve the SDK from PyPI, so this checks the published release against the sample
54+ # code -- it does NOT exercise the working tree, and will not catch a breaking API change here.
5455samples :
5556 @for sample in samples/* /; do \
5657 [ -f " $$ sample/pyproject.toml" ] || continue ; \
5758 printf ' \n\033[1m==> sample %s\033[0m\n' " $$ (basename $$ sample)" ; \
5859 (cd " $$ sample" && uv sync --quiet && uv run mypy && uv run pytest) || exit 1; \
5960 done
6061
62+ # Companion to `samples`: the same apps, resolved against the SDK in this working tree instead
63+ # of the released wheel. `samples` proves the published release still works with the sample code;
64+ # this proves an unreleased API change has not broken it. Without this target a breaking change
65+ # passes every check, because the samples pin a version from PyPI.
66+ #
67+ # uv sync installs the pinned release, then the editable install replaces it in the same
68+ # environment, and --no-sync stops uv from undoing that before the checks run. The override is
69+ # not written to any file, so nothing here can be committed by accident; the next plain
70+ # `make samples` restores the released version.
71+ samples-local :
72+ @for sample in samples/* /; do \
73+ [ -f " $$ sample/pyproject.toml" ] || continue ; \
74+ printf ' \n\033[1m==> sample %s (working-tree SDK)\033[0m\n' " $$ (basename $$ sample)" ; \
75+ (cd " $$ sample" && uv sync --quiet && uv pip install --quiet -e ../.. \
76+ && uv run --no-sync mypy && uv run --no-sync pytest) || exit 1; \
77+ done
78+
6179# Exploratory load profile of the Flask sample: see profiling/README.md. Deliberately not part
6280# of `check-all` — it needs a real server SDK key, takes minutes, and measures the machine it
6381# ran on as much as the SDK. Pass options through, e.g. `make profile ARGS="--rps 100"`.
@@ -69,7 +87,7 @@ profile:
6987check : lint typecheck test
7088
7189# Everything CI runs. The pre-push hook calls this.
72- check-all : verify-lock lint typecheck test dist-check samples
90+ check-all : verify-lock lint typecheck test dist-check samples samples-local
7391 @printf ' \n\033[1m✓ all checks passed\033[0m\n'
7492
7593clean :
0 commit comments