From e65903a932fd8df978bb5c15a94d45bc78c47201 Mon Sep 17 00:00:00 2001 From: Leodanis Pozo Ramos Date: Tue, 10 Nov 2026 14:34:52 +0000 Subject: [PATCH] Key the linters' venv cache on the exact Python version The cached ./venv links to the interpreter it was built with. Since #917 resolves '3.14' to the latest patch, a new patch release (3.14.9 to 3.14.10) leaves the cached venv pointing at a missing interpreter, and the cache hit skips the install, so 'python -m ruff' runs without Ruff. Include setup-python's resolved python-version in the cache key, so each patch release builds a fresh venv, and update checkout, setup-python, and cache to their current major versions (as proposed in #717). Co-Authored-By: Claude Opus 5.5 --- .github/workflows/linters.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index 75fc5b94e1..fb3df6f055 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -21,21 +21,24 @@ jobs: - {name: Linux314, python: '3.14', os: ubuntu-latest} steps: - name: Check out repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v2 + id: setup-python + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python }} + # The cached venv links to the exact interpreter it was built with, + # so the key includes the resolved patch version (for example, 3.14.10). - name: Restore cache id: cache - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ./venv - key: ${{ matrix.name }}-v2-pip-${{ hashFiles('requirements.txt') }} + key: ${{ matrix.name }}-${{ steps.setup-python.outputs.python-version }}-pip-${{ hashFiles('requirements.txt') }} restore-keys: | - ${{ matrix.name }}-v2-pip- + ${{ matrix.name }}-${{ steps.setup-python.outputs.python-version }}-pip- - name: Install dependencies if: steps.cache.outputs.cache-hit != 'true'