Skip to content

Commit

Permalink
use setup-cached-uv in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
jab committed Aug 25, 2024
1 parent 4b285a0 commit 2fb2d99
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,13 @@ jobs:
python-version: '3.12.2'
cache: pip
cache-dependency-path: dev-deps/test.txt
- uses: hynek/setup-cached-uv@4b4bfa932036976749a9653b0fa4fa10b1a7092b
- name: install PyPI dependencies
run: |
python -m pip install -U uv
python -m uv pip install -r dev-deps/test.txt
run: uv venv && uv pip install -r dev-deps/test.txt
- name: install the version of bidict to benchmark
run: |
git checkout ${{ github.event.inputs.ref || github.sha }}
python -m uv pip install .
uv pip install --no-deps -e .
# restore the current revision so we use its version of tests/microbenchmarks.py
git checkout ${{ github.sha }}
# move aside the 'bidict' subdirectory to make sure we always import the installed version
Expand All @@ -59,7 +58,7 @@ jobs:
[ "$line1" = "{" ]
- name: benchmark and compare to baseline
run: |
./cachegrind.py pytest -n0 \
./cachegrind.py uv run pytest -n0 \
--benchmark-autosave \
--benchmark-columns=min,rounds,iterations \
--benchmark-disable-gc \
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,16 @@ jobs:
python-version: ${{ matrix.pyversion }}
cache: pip
cache-dependency-path: dev-deps/test.txt
- uses: hynek/setup-cached-uv@4b4bfa932036976749a9653b0fa4fa10b1a7092b
- name: install dependencies
run: |
python -m pip install -U uv
python -m uv pip install -r dev-deps/test.txt
run: uv venv && uv pip install -r dev-deps/test.txt
- name: cache .mypy_cache dir
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
with:
path: .mypy_cache
key: mypy
- name: run mypy
run: python -m mypy bidict tests
run: uv run mypy bidict tests
- name: set hypothesis profile
run: |
hypothesis_profile=${{ github.event.inputs.hypothesis_profile || (github.event_name == 'schedule' && 'more-examples' || 'default') }}
Expand All @@ -83,7 +82,7 @@ jobs:
run: |
echo COVERAGE_CORE=sysmon >> "${GITHUB_ENV}"
- name: run pytest
run: ${RUN_PYTEST_CMD:-python} -m pytest
run: uv run ${RUN_PYTEST_CMD:-python} -m pytest
- name: combine and show any collected coverage
if: matrix.enable_coverage
run: |
Expand Down
7 changes: 7 additions & 0 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2fb2d99

Please sign in to comment.