@@ -12,19 +12,12 @@ jobs:
12
12
fail-fast : false
13
13
matrix :
14
14
python-version :
15
- - 2.7
16
- - 3.5
17
- - 3.6
18
- - 3.7
19
15
- 3.8
20
16
- 3.9
21
17
- ' 3.10'
22
18
- 3.11
23
19
- 3.12
24
20
# As per https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-Readme.md#pypy list of versions
25
- - pypy-2.7
26
- - pypy-3.6
27
- - pypy-3.7
28
21
- pypy-3.8
29
22
- pypy-3.9
30
23
- pypy-3.10
58
51
with :
59
52
python-version : ${{ matrix.python-version }}
60
53
61
- - name : Set up Python 2.7
62
- if : matrix.python-version == '2.7'
63
- run : |
64
- sudo apt-get update
65
- sudo apt-get install python2.7 -y
66
- # Get everything to use this new Python as the default.
67
- curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py
68
- sudo python2.7 get-pip.py
69
- sudo ln -sf /usr/bin/pip2 /usr/bin/pip
70
- sudo ln -sf /usr/bin/python2.7 /usr/bin/python
71
-
72
54
- name : Install dependencies
73
55
run : |
74
56
pip install --upgrade coveralls pytest setuptools setuptools_scm pep517
@@ -79,19 +61,13 @@ jobs:
79
61
# Not an exact mypy version, as we need 0.942 for pypy-3.8 support, but it's not available on 3.5
80
62
pip install types-six "mypy>=0.910,<=0.942"
81
63
python -m mypy asttokens tests/*.py
82
- # fromJson because https://i.8713187.xyzmunity/t/passing-an-array-literal-to-contains-function-causes-syntax-error/17213/3
83
- if : ${{ !contains(fromJson('["2.7", "pypy-2.7", "pypy-3.6", "pypy-3.7"]'), matrix.python-version) }}
84
- # pypy < 3.8 very doesn't work
85
- # 2.7 is tested separately in mypy-py2, as we need to run mypy under Python 3.x
86
64
87
65
- name : Fast tests with coverage
88
66
run : |
89
67
pytest --cov -n auto -m "not slow"
90
68
coverage report -m
91
69
92
70
- name : Slow tests without coverage
93
- # Python 2.7 doesn't have any slow tests
94
- if : ${{ !contains(fromJson('["2.7", "pypy-2.7"]'), matrix.python-version) }}
95
71
run : |
96
72
pytest -n auto -m slow
97
73
@@ -102,27 +78,6 @@ jobs:
102
78
pip3 install --upgrade coveralls
103
79
python3 -m coveralls --service=github
104
80
105
- # Can't run mypy on Python 2.7, but can run it in Python 2 mode
106
- mypy-py2 :
107
- runs-on : ubuntu-latest
108
- steps :
109
- - uses : actions/checkout@v3
110
-
111
- - name : Set up Python 3.9
112
- uses : actions/setup-python@v4
113
- with :
114
- python-version : 3.9
115
-
116
- - name : Install dependencies
117
- run : |
118
- pip install --upgrade setuptools setuptools_scm pep517
119
- pip install .[test]
120
- pip install types-six==1.16.10 mypy[python2]==0.910
121
-
122
- - name : Mypy testing for Python 2
123
- run : |
124
- python -m mypy --py2 asttokens
125
-
126
81
finish :
127
82
needs : test
128
83
runs-on : ubuntu-latest
0 commit comments