Skip to content

Commit e65903a

Browse files
lpozoclaude
andcommitted
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 <noreply@anthropic.com>
1 parent b7375ca commit e65903a

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

‎.github/workflows/linters.yml‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,24 @@ jobs:
2121
- {name: Linux314, python: '3.14', os: ubuntu-latest}
2222
steps:
2323
- name: Check out repository
24-
uses: actions/checkout@v2
24+
uses: actions/checkout@v4
2525

2626
- name: Set up Python
27-
uses: actions/setup-python@v2
27+
id: setup-python
28+
uses: actions/setup-python@v5
2829
with:
2930
python-version: ${{ matrix.python }}
3031

32+
# The cached venv links to the exact interpreter it was built with,
33+
# so the key includes the resolved patch version (for example, 3.14.10).
3134
- name: Restore cache
3235
id: cache
33-
uses: actions/cache@v3
36+
uses: actions/cache@v4
3437
with:
3538
path: ./venv
36-
key: ${{ matrix.name }}-v2-pip-${{ hashFiles('requirements.txt') }}
39+
key: ${{ matrix.name }}-${{ steps.setup-python.outputs.python-version }}-pip-${{ hashFiles('requirements.txt') }}
3740
restore-keys: |
38-
${{ matrix.name }}-v2-pip-
41+
${{ matrix.name }}-${{ steps.setup-python.outputs.python-version }}-pip-
3942
4043
- name: Install dependencies
4144
if: steps.cache.outputs.cache-hit != 'true'

0 commit comments

Comments
 (0)