File tree 5 files changed +14
-17
lines changed
5 files changed +14
-17
lines changed Original file line number Diff line number Diff line change 50
50
path : venv
51
51
key :
52
52
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
53
- env.KEY_PREFIX }}-${{ env.CACHE_VERSION }}
53
+ env.KEY_PREFIX }}-${{ env.CACHE_VERSION }}-${{ hashFiles('pyproject.toml',
54
+ ' requirements_test.txt' , 'requirements_test_min.txt') }}
54
55
- name : Fail job if Python cache restore failed
55
56
if : steps.cache-venv.outputs.cache-hit != 'true'
56
57
run : |
Original file line number Diff line number Diff line change 37
37
python-version : ${{ matrix.python-version }}
38
38
check-latest : true
39
39
40
- - name : Get latest astroid commit
41
- id : get-astroid-sha
42
- run : |
43
- curl https://api.github.com/repos/PyCQA/astroid/commits |
44
- python -c "import json, sys; print(json.load(sys.stdin)[0]['sha'])" > astroid_sha.txt
45
-
46
40
# Create a re-usable virtual environment
47
41
- name : Create Python virtual environment cache
48
42
id : cache-venv
@@ -51,15 +45,15 @@ jobs:
51
45
path : venv
52
46
key :
53
47
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
54
- env.KEY_PREFIX }}-${{ env.CACHE_VERSION }}
48
+ env.KEY_PREFIX }}-${{ env.CACHE_VERSION }}-${{ hashFiles('pyproject.toml',
49
+ ' requirements_test.txt' , 'requirements_test_min.txt') }}
55
50
- name : Create Python virtual environment
51
+ if : steps.cache-venv.outputs.cache-hit != 'true'
56
52
run : |
57
53
python -m venv venv
58
54
. venv/bin/activate
59
55
python -m pip install -U pip setuptools wheel
60
56
pip install -U -r requirements_test.txt
61
- # Use bleeding-edge astroid
62
- pip install git+https://github.com/PyCQA/astroid.git
63
57
64
58
# Cache primer packages
65
59
- name : Get commit string
Original file line number Diff line number Diff line change @@ -60,12 +60,16 @@ jobs:
60
60
path : venv
61
61
key :
62
62
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
63
- env.KEY_PREFIX }}-${{ env.CACHE_VERSION }}
64
- - name : Fail job if Python cache restore failed
63
+ env.KEY_PREFIX }}-${{ env.CACHE_VERSION }}-${{ hashFiles('pyproject.toml',
64
+ ' requirements_test.txt' , 'requirements_test_min.txt') }}
65
+ # Create environment must match step in 'Primer / Main'
66
+ - name : Create Python virtual environment
65
67
if : steps.cache-venv.outputs.cache-hit != 'true'
66
68
run : |
67
- echo "Failed to restore Python venv from cache"
68
- exit 1
69
+ python -m venv venv
70
+ . venv/bin/activate
71
+ python -m pip install -U pip setuptools wheel
72
+ pip install -U -r requirements_test.txt
69
73
70
74
# Cache primer packages
71
75
- name : Download last 'main' run info
Original file line number Diff line number Diff line change @@ -34,8 +34,7 @@ requires-python = ">=3.7.2"
34
34
dependencies = [
35
35
" dill>=0.2" ,
36
36
" platformdirs>=2.2.0" ,
37
- # Also upgrade requirements_test_min.txt and all the CACHE_VERSION for primer tests
38
- # in github actions if you are bumping astroid.
37
+ # Also upgrade requirements_test_min.txt.
39
38
# Pinned to dev of second minor update to allow editable installs and fix primer issues,
40
39
# see https://github.com/PyCQA/astroid/issues/1341
41
40
" astroid>=2.12.12,<=2.14.0-dev0" ,
Original file line number Diff line number Diff line change 1
1
-e .[testutils,spelling]
2
2
# astroid dependency is also defined in pyproject.toml
3
- # You need to increment the CACHE_VERSION for primer tests in github actions too
4
3
astroid==2.12.12 # Pinned to a specific version for tests
5
4
typing-extensions~=4.3
6
5
py~=1.11.0
You can’t perform that action at this time.
0 commit comments