From da641999236e6b8ea2485f8462145f1489005633 Mon Sep 17 00:00:00 2001 From: Miguel Angel Ajo Pelayo Date: Tue, 23 Jun 2026 20:11:12 +0200 Subject: [PATCH 1/2] fix: use shared uv cache for package tests Remove per-package UV_CACHE_DIR override from Makefile test targets. Previously each package set UV_CACHE_DIR to a separate directory (.uv-cache/), preventing packages from sharing cached downloads and built wheels. This caused redundant downloads and builds of common dependencies (grpcio, protobuf, etc.) across every package test run. By using uv's default shared cache (~/.cache/uv on Linux, ~/Library/Caches/uv on macOS), all package test venvs now reuse the same cached artifacts, significantly speeding up test runs. --- python/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/Makefile b/python/Makefile index 6b513ce2d..d9bf071ef 100644 --- a/python/Makefile +++ b/python/Makefile @@ -85,7 +85,7 @@ pkg-test-%: packages/% @mkdir -p $(LOGS_DIR) @rm -f $(LOGS_DIR)/$*.failed @bash -c 'set -o pipefail; \ - UV_CACHE_DIR="$(CURDIR)/.uv-cache/$*" PYTHONUNBUFFERED=1 uv run --isolated --directory $< pytest 2>&1 | tee $(LOGS_DIR)/$*.log; \ + PYTHONUNBUFFERED=1 uv run --isolated --directory $< pytest 2>&1 | tee $(LOGS_DIR)/$*.log; \ rc=$$?; \ if [ $$rc -ne 0 ] && [ $$rc -ne 5 ]; then \ touch $(LOGS_DIR)/$*.failed; \ @@ -93,7 +93,7 @@ pkg-test-%: packages/% true' else pkg-test-%: packages/% - UV_CACHE_DIR="$(CURDIR)/.uv-cache/$*" uv run --isolated --directory $< pytest || [ $$? -eq 5 ] + uv run --isolated --directory $< pytest || [ $$? -eq 5 ] endif pkg-ty-%: packages/% From 46a8f9b5f6d7972f68c47c2e5029f34d4aa6a306 Mon Sep 17 00:00:00 2001 From: Miguel Angel Ajo Pelayo Date: Tue, 23 Jun 2026 20:57:58 +0200 Subject: [PATCH 2/2] fix: add sync dependency to pre-warm uv cache before parallel tests Run 'uv sync --all-packages --all-extras' before parallel pkg-test-% targets to ensure all dependencies are already cached. This avoids cache write contention during parallel test runs while still benefiting from a shared cache. --- python/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/Makefile b/python/Makefile index d9bf071ef..f8af791db 100644 --- a/python/Makefile +++ b/python/Makefile @@ -99,7 +99,7 @@ endif pkg-ty-%: packages/% uv run --isolated --directory $< ty check . -pkg-test-all: $(addprefix pkg-test-,$(PKG_TARGETS)) +pkg-test-all: sync $(addprefix pkg-test-,$(PKG_TARGETS)) ifdef LOGS_DIR test-report: