diff --git a/.github/workflows/benchmarks.yaml b/.github/workflows/benchmarks.yaml index df3e10e..e83b35f 100644 --- a/.github/workflows/benchmarks.yaml +++ b/.github/workflows/benchmarks.yaml @@ -42,19 +42,25 @@ jobs: enable-cache: true - name: Benchmark head - run: > - uv run --with "$BENCHMEM" pytest benchmarks/ $BENCH_ARGS - --benchmark-json "$RUNNER_TEMP/head.json" + run: | + uv run --with "$BENCHMEM" pytest benchmarks/ $BENCH_ARGS \ + --benchmark-json "$RUNNER_TEMP/head.json" + uv run --no-sync python -c "import tsam; print('head tsam:', tsam.__version__)" - name: Benchmark base (${{ github.event.pull_request.base.ref }}) if: github.event_name == 'pull_request' # Base src with the head's benchmark suite overlaid, so test IDs match # and suite edits in the PR still compare against the same cases. + # Drop the head run's uv.lock (untracked — the repo commits none): + # uv keeps a satisfying lock as-is, so without this a head that + # changes dependencies leaks its resolution into the base run. run: | git checkout --detach ${{ github.event.pull_request.base.sha }} git checkout ${{ github.sha }} -- benchmarks/ + rm -f uv.lock uv run --with "$BENCHMEM" pytest benchmarks/ $BENCH_ARGS \ --benchmark-json "$RUNNER_TEMP/base.json" + uv run --no-sync python -c "import tsam; print('base tsam:', tsam.__version__)" - name: Render report and plot run: | diff --git a/pyproject.toml b/pyproject.toml index b308d56..19472e3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -84,3 +84,6 @@ exclude_lines = [ [tool.pytest.ini_options] testpaths = ["test"] addopts = ["-n", "auto", "--dist", "loadfile"] + +[tool.uv.sources] +tsam = { git = "https://github.com/FZJ-IEK3-VSA/tsam", branch = "develop-v4" }