diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index e5a8e18e2..28c951cd1 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -21,30 +21,12 @@ jobs: percentage_float: ${{ steps.cov.outputs.percentage_float }} steps: - uses: actions/checkout@v4 - - name: Set up base Python - uses: actions/setup-python@v5 + - name: Set up uv + uses: astral-sh/setup-uv@v5 with: - # Note that this is just the version of Python that we use to run `uv` with. - # `uv` manages its own version of Python. - # For speed, we use the same version for both, but in principle these could differ. + version: "latest" python-version: 3.13 - - name: Set up uv cache directory location (Linux/Mac) - run: echo "UV_CACHE_DIR=${{ runner.temp }}/.uv-cache" >> $GITHUB_ENV - if: runner.os != 'Windows' - - name: Set up uv cache directory location (Windows) - run: echo "UV_CACHE_DIR=${{ runner.temp }}/.uv-cache" >> $env:GITHUB_ENV - if: runner.os == 'Windows' - - name: Restore uv cache - uses: actions/cache@v4 - with: - path: ${{ env.UV_CACHE_DIR }} - key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}-${{ matrix.python-version }}-test - restore-keys: | - uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}-${{ matrix.python-version }} - uv-${{ runner.os }}-${{ hashFiles('uv.lock') }} - uv-${{ runner.os }} - - name: Install latest versions of pip and uv - run: python -m pip install --upgrade pip uv + enable-cache: true - name: Install test dependencies run: uv sync --extra test --no-dev --locked - name: Debug - uv pip freeze @@ -78,9 +60,7 @@ jobs: uv run tests/coverage/compare.py \ ${{ steps.cov.outputs.percentage_float }} \ $HISTORIC - - name: Minimize UV cache - run: uv cache prune --ci - if: always() + coverage-badge: name: Update coverage badge # Keep as a separate job to avoid clashes between meta and main repos diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 0c0f2d13c..9cc0c43ea 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -13,37 +13,19 @@ jobs: name: Build documentation runs-on: ubuntu-latest env: - # Note that we use 3.12 here rather than 3.13 to avoid spurious Sphinx errors - # about not being able to link to `pathlib._locals.Path`. - UV_PYTHON: 3.12 # Disable implicitly syncing before running - we run an explicit sync first. UV_NO_SYNC: true steps: - uses: actions/checkout@v4 - - name: Set up base Python - uses: actions/setup-python@v5 + - name: Set up uv + uses: astral-sh/setup-uv@v5 with: - # Note that this is just the version of Python that we use to run `uv` with. - # `uv` manages its own version of Python. - # For speed, we use the same version for both, but in principle these could differ. + version: "latest" + # Note that we use 3.12 here rather than 3.13 to avoid spurious Sphinx errors + # about not being able to link to `pathlib._locals.Path`. python-version: 3.12 - - name: Set up uv cache directory location (Linux/Mac) - run: echo "UV_CACHE_DIR=${{ runner.temp }}/.uv-cache" >> $GITHUB_ENV - if: runner.os != 'Windows' - - name: Set up uv cache directory location (Windows) - run: echo "UV_CACHE_DIR=${{ runner.temp }}/.uv-cache" >> $env:GITHUB_ENV - if: runner.os == 'Windows' - - name: Restore uv cache - uses: actions/cache@v4 - with: - path: ${{ env.UV_CACHE_DIR }} - key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}-${{ matrix.python-version }}-test - restore-keys: | - uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}-${{ matrix.python-version }} - uv-${{ runner.os }}-${{ hashFiles('uv.lock') }} - uv-${{ runner.os }} - - name: Install latest versions of pip and uv - run: python -m pip install --upgrade pip uv + enable-cache: true + cache-suffix: "docs" - name: Install documentation dependencies run: uv sync --extra doc --no-dev --locked - name: Debug - uv pip freeze @@ -54,6 +36,3 @@ jobs: - name: Check external links run: | uv run -m sphinx -b linkcheck documentation/source documentation/build - - name: Minimize UV cache - run: uv cache prune --ci - if: always() diff --git a/.github/workflows/performance.yml b/.github/workflows/performance.yml index acbd625a5..13844e802 100644 --- a/.github/workflows/performance.yml +++ b/.github/workflows/performance.yml @@ -18,30 +18,13 @@ jobs: UV_NO_SYNC: true steps: - uses: actions/checkout@v4 - - name: Set up base Python - uses: actions/setup-python@v5 + - name: Set up uv + uses: astral-sh/setup-uv@v5 with: - # Note that this is just the version of Python that we use to run `uv` with. - # `uv` manages its own version of Python. - # For speed, we use the same version for both, but in principle these could differ. - python-version: 3.13 - - name: Set up uv cache directory location (Linux/Mac) - run: echo "UV_CACHE_DIR=${{ runner.temp }}/.uv-cache" >> $GITHUB_ENV - if: runner.os != 'Windows' - - name: Set up uv cache directory location (Windows) - run: echo "UV_CACHE_DIR=${{ runner.temp }}/.uv-cache" >> $env:GITHUB_ENV - if: runner.os == 'Windows' - - name: Restore uv cache - uses: actions/cache@v4 - with: - path: ${{ env.UV_CACHE_DIR }} - key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}-${{ matrix.python-version }}-none - restore-keys: | - uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}-${{ matrix.python-version }} - uv-${{ runner.os }}-${{ hashFiles('uv.lock') }} - uv-${{ runner.os }} - - name: Install latest versions of pip and uv - run: python -m pip install --upgrade pip uv + version: "latest" + python-version: 3.12 + enable-cache: true + cache-suffix: "performance" - name: Install package dependencies run: uv sync --no-dev --locked - name: Debug - uv pip freeze @@ -109,6 +92,3 @@ jobs: /repos/:owner/coreax-metadata/contents/$OUT_NAME \ -f message="$message" \ -f content="$content" - - name: Minimize UV cache - run: uv cache prune --ci - if: always() diff --git a/.github/workflows/pre_commit_autoupdate.yml b/.github/workflows/pre_commit_autoupdate.yml index eed0b2ee0..8d8e8f637 100644 --- a/.github/workflows/pre_commit_autoupdate.yml +++ b/.github/workflows/pre_commit_autoupdate.yml @@ -45,15 +45,11 @@ jobs: fi # Pre-commit setup and autoupdate steps - - name: Set up Python 3.13 - uses: actions/setup-python@v5 + - name: Set up uv + uses: astral-sh/setup-uv@v5 with: + version: "latest" python-version: 3.13 - cache: pip - - name: Upgrade Pip - run: python -m pip install --upgrade pip - - name: Install pre-commit - run: pip install pre-commit - name: Store hash of baseline pre-commit config for comparison id: old_file run: echo "hash=$( sha256sum $config_path )" >> $GITHUB_OUTPUT @@ -65,7 +61,7 @@ jobs: - name: Run pre-commit autoupdate on main pre-commit config id: autoupdate run: | - pre-commit autoupdate > ${{ env.update_message_path }} + uv tool pre-commit autoupdate > ${{ env.update_message_path }} sed -i "/updating/!d" ${{ env.update_message_path }} - name: Store hash of new pre-commit config for comparison id: new_file diff --git a/.github/workflows/pre_commit_checks.yml b/.github/workflows/pre_commit_checks.yml index 817d146eb..6cc513193 100644 --- a/.github/workflows/pre_commit_checks.yml +++ b/.github/workflows/pre_commit_checks.yml @@ -16,30 +16,13 @@ jobs: UV_NO_SYNC: true steps: - uses: actions/checkout@v4 - - name: Set up base Python - uses: actions/setup-python@v5 + - name: Set up uv + uses: astral-sh/setup-uv@v5 with: - # Note that this is just the version of Python that we use to run `uv` with. - # `uv` manages its own version of Python. - # For speed, we use the same version for both, but in principle these could differ. + version: "latest" python-version: 3.13 - - name: Set up uv cache directory location (Linux/Mac) - run: echo "UV_CACHE_DIR=${{ runner.temp }}/.uv-cache" >> $GITHUB_ENV - if: runner.os != 'Windows' - - name: Set up uv cache directory location (Windows) - run: echo "UV_CACHE_DIR=${{ runner.temp }}/.uv-cache" >> $env:GITHUB_ENV - if: runner.os == 'Windows' - - name: Restore uv cache - uses: actions/cache@v4 - with: - path: ${{ env.UV_CACHE_DIR }} - key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}-${{ matrix.python-version }}-dev - restore-keys: | - uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}-${{ matrix.python-version }} - uv-${{ runner.os }}-${{ hashFiles('uv.lock') }} - uv-${{ runner.os }} - - name: Install latest versions of pip and uv - run: python -m pip install --upgrade pip uv + enable-cache: true + cache-suffix: "pre-commit" - name: Install development dependencies run: uv sync --dev --locked - name: Debug - uv pip freeze @@ -48,6 +31,3 @@ jobs: run: sed -e "/fail_fast/d" .pre-commit-config.yaml > /tmp/.pre-commit-config-ci.yaml - name: Run Pre-commit checks run: SKIP=no-commit-to-branch uv run pre-commit run --all-files --show-diff-on-failure --config /tmp/.pre-commit-config-ci.yaml - - name: Minimize UV cache - run: uv cache prune --ci - if: always() diff --git a/.github/workflows/pyright.yml b/.github/workflows/pyright.yml index bc71b271f..afcf4b4bc 100644 --- a/.github/workflows/pyright.yml +++ b/.github/workflows/pyright.yml @@ -17,30 +17,13 @@ jobs: UV_NO_SYNC: true steps: - uses: actions/checkout@v4 - - name: Set up base Python - uses: actions/setup-python@v5 + - name: Set up uv + uses: astral-sh/setup-uv@v5 with: - # Note that this is just the version of Python that we use to run `uv` with. - # `uv` manages its own version of Python. - # For speed, we use the same version for both, but in principle these could differ. + version: "latest" python-version: 3.13 - - name: Set up uv cache directory location (Linux/Mac) - run: echo "UV_CACHE_DIR=${{ runner.temp }}/.uv-cache" >> $GITHUB_ENV - if: runner.os != 'Windows' - - name: Set up uv cache directory location (Windows) - run: echo "UV_CACHE_DIR=${{ runner.temp }}/.uv-cache" >> $env:GITHUB_ENV - if: runner.os == 'Windows' - - name: Restore uv cache - uses: actions/cache@v4 - with: - path: ${{ env.UV_CACHE_DIR }} - key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}-${{ matrix.python-version }}-dev - restore-keys: | - uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}-${{ matrix.python-version }} - uv-${{ runner.os }}-${{ hashFiles('uv.lock') }} - uv-${{ runner.os }} - - name: Install latest versions of pip and uv - run: python -m pip install --upgrade pip uv + enable-cache: true + cache-suffix: "pre-commit" - name: Install dev dependencies run: uv sync --dev --locked - name: Debug - uv pip freeze diff --git a/.github/workflows/unittests.yml b/.github/workflows/unittests.yml index 0c72ba205..77f2e6dd8 100644 --- a/.github/workflows/unittests.yml +++ b/.github/workflows/unittests.yml @@ -25,36 +25,16 @@ jobs: - macos-latest runs-on: ${{ matrix.os }} env: - # Set the Python version that `uv` will use for its virtual environment. - UV_PYTHON: ${{ matrix.python-version }} # Disable implicitly syncing before running - we run an explicit sync first. UV_NO_SYNC: true steps: - uses: actions/checkout@v4 - - name: Set up base Python - uses: actions/setup-python@v5 + - name: Set up uv + uses: astral-sh/setup-uv@v5 with: - # Note that this is just the version of Python that we use to run `uv` with. - # `uv` manages its own version of Python. - # For speed, we use the same version for both, but in principle these could differ. + version: "latest" python-version: ${{ matrix.python-version }} - - name: Set up uv cache directory location (Linux/Mac) - run: echo "UV_CACHE_DIR=${{ runner.temp }}/.uv-cache" >> $GITHUB_ENV - if: runner.os != 'Windows' - - name: Set up uv cache directory location (Windows) - run: echo "UV_CACHE_DIR=${{ runner.temp }}/.uv-cache" >> $env:GITHUB_ENV - if: runner.os == 'Windows' - - name: Restore uv cache - uses: actions/cache@v4 - with: - path: ${{ env.UV_CACHE_DIR }} - key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}-${{ matrix.python-version }}-test - restore-keys: | - uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}-${{ matrix.python-version }} - uv-${{ runner.os }}-${{ hashFiles('uv.lock') }} - uv-${{ runner.os }} - - name: Install latest versions of pip and uv - run: python -m pip install --upgrade pip uv + enable-cache: true - name: Install test dependencies run: uv sync --extra test --no-dev --locked - name: Debug - uv pip freeze @@ -64,6 +44,3 @@ jobs: # Integration tests are slow, so only run if all other tests pass. - name: Test integration tests run: uv run pytest tests/integration -n auto --dist worksteal - - name: Minimize UV cache - run: uv cache prune --ci - if: always() diff --git a/.github/workflows/uv_lock_autoupdate.yml b/.github/workflows/uv_lock_autoupdate.yml index 2616d629d..9fc7107c9 100644 --- a/.github/workflows/uv_lock_autoupdate.yml +++ b/.github/workflows/uv_lock_autoupdate.yml @@ -47,15 +47,11 @@ jobs: fi # uv setup and lockfile upgrading steps - - name: Set up Python 3.13 - uses: actions/setup-python@v5 + - name: Set up uv + uses: astral-sh/setup-uv@v5 with: + version: "latest" python-version: 3.13 - cache: pip - - name: Upgrade Pip - run: python -m pip install --upgrade pip - - name: Install uv - run: pip install uv - name: Store hash of baseline files for comparison id: old_hash run: |