15
15
- CREDITS
16
16
- LICENSE
17
17
18
+ permissions :
19
+ contents : read
20
+
18
21
concurrency :
19
22
group : ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
20
23
cancel-in-progress : true
@@ -33,47 +36,74 @@ jobs:
33
36
arch : x64
34
37
os : ubuntu-latest
35
38
toxenv : py
36
- tox_extra_args : " -n 2 "
39
+ tox_extra_args : " -n 4 "
37
40
test_mypyc : true
38
41
- name : Test suite with py38-windows-64
39
42
python : ' 3.8'
40
43
arch : x64
41
44
os : windows-latest
42
45
toxenv : py38
43
- tox_extra_args : " -n 2 "
46
+ tox_extra_args : " -n 4 "
44
47
- name : Test suite with py39-ubuntu
45
48
python : ' 3.9'
46
49
arch : x64
47
50
os : ubuntu-latest
48
51
toxenv : py
49
- tox_extra_args : " -n 2 "
52
+ tox_extra_args : " -n 4 "
50
53
- name : Test suite with py310-ubuntu
51
54
python : ' 3.10'
52
55
arch : x64
53
56
os : ubuntu-latest
54
57
toxenv : py
55
- tox_extra_args : " -n 2 "
58
+ tox_extra_args : " -n 4 "
56
59
- name : Test suite with py311-ubuntu, mypyc-compiled
57
60
python : ' 3.11'
58
61
arch : x64
59
62
os : ubuntu-latest
60
63
toxenv : py
61
- tox_extra_args : " -n 2 "
64
+ tox_extra_args : " -n 4 "
62
65
test_mypyc : true
63
-
64
- - name : mypyc runtime tests with py38-macos
65
- python : ' 3.8.17'
66
+ - name : Test suite with py312-ubuntu, mypyc-compiled
67
+ python : ' 3.12'
66
68
arch : x64
67
- os : macos -latest
69
+ os : ubuntu -latest
68
70
toxenv : py
69
- tox_extra_args : " -n 2 mypyc/test/test_run.py mypyc/test/test_external.py"
70
- - name : mypyc runtime tests with py38-debug-build-ubuntu
71
- python : ' 3.8.17'
71
+ tox_extra_args : " -n 4"
72
+ test_mypyc : true
73
+ - name : Test suite with py313-ubuntu, mypyc-compiled
74
+ python : ' 3.13'
72
75
arch : x64
73
76
os : ubuntu-latest
74
77
toxenv : py
75
- tox_extra_args : " -n 2 mypyc/test/test_run.py mypyc/test/test_external.py"
76
- debug_build : true
78
+ tox_extra_args : " -n 4"
79
+ test_mypyc : true
80
+
81
+ # - name: Test suite with py314-dev-ubuntu
82
+ # python: '3.14-dev'
83
+ # arch: x64
84
+ # os: ubuntu-latest
85
+ # toxenv: py
86
+ # tox_extra_args: "-n 4"
87
+ # allow_failure: true
88
+ # test_mypyc: true
89
+
90
+ - name : mypyc runtime tests with py39-macos
91
+ python : ' 3.9.18'
92
+ arch : x64
93
+ # TODO: macos-13 is the last one to support Python 3.9, change it to macos-latest when updating the Python version
94
+ os : macos-13
95
+ toxenv : py
96
+ tox_extra_args : " -n 3 mypyc/test/test_run.py mypyc/test/test_external.py"
97
+ # This is broken. See
98
+ # - https://github.com/python/mypy/issues/17819
99
+ # - https://github.com/python/mypy/pull/17822
100
+ # - name: mypyc runtime tests with py38-debug-build-ubuntu
101
+ # python: '3.8.17'
102
+ # arch: x64
103
+ # os: ubuntu-latest
104
+ # toxenv: py
105
+ # tox_extra_args: "-n 4 mypyc/test/test_run.py mypyc/test/test_external.py"
106
+ # debug_build: true
77
107
78
108
- name : Type check our own code (py38-ubuntu)
79
109
python : ' 3.8'
98
128
name : ${{ matrix.name }}
99
129
env :
100
130
TOX_SKIP_MISSING_INTERPRETERS : False
101
- # Rich (pip)
102
- FORCE_COLOR : 1
131
+ # Rich (pip) -- Disable color for windows + pytest
132
+ FORCE_COLOR : ${{ !(startsWith(matrix.os, 'windows-') && startsWith(matrix.toxenv, 'py')) && 1 || 0 }}
103
133
# Tox
104
134
PY_COLORS : 1
105
135
# Mypy (see https://github.com/python/mypy/issues/7771)
@@ -108,49 +138,69 @@ jobs:
108
138
MYPY_FORCE_TERMINAL_WIDTH : 200
109
139
# Pytest
110
140
PYTEST_ADDOPTS : --color=yes
141
+
111
142
steps :
112
- - uses : actions/checkout@v3
113
- - uses : actions/setup-python@v4
114
- with :
115
- python-version : ${{ matrix.python }}
116
- architecture : ${{ matrix.arch }}
143
+ - uses : actions/checkout@v4
144
+
117
145
- name : Debug build
118
146
if : ${{ matrix.debug_build }}
119
147
run : |
120
148
PYTHONVERSION=${{ matrix.python }}
121
149
PYTHONDIR=~/python-debug/python-$PYTHONVERSION
122
150
VENV=$PYTHONDIR/env
123
151
./misc/build-debug-python.sh $PYTHONVERSION $PYTHONDIR $VENV
152
+ # TODO: does this do anything? env vars aren't passed to the next step right
124
153
source $VENV/bin/activate
154
+ - name : Latest dev build
155
+ if : ${{ endsWith(matrix.python, '-dev') }}
156
+ run : |
157
+ git clone --depth 1 https://github.com/python/cpython.git /tmp/cpython --branch $( echo ${{ matrix.python }} | sed 's/-dev//' )
158
+ cd /tmp/cpython
159
+ echo git rev-parse HEAD; git rev-parse HEAD
160
+ git show --no-patch
161
+ sudo apt-get update
162
+ sudo apt-get install -y --no-install-recommends \
163
+ build-essential gdb lcov libbz2-dev libffi-dev libgdbm-dev liblzma-dev libncurses5-dev \
164
+ libreadline6-dev libsqlite3-dev libssl-dev lzma lzma-dev tk-dev uuid-dev zlib1g-dev
165
+ ./configure --prefix=/opt/pythondev
166
+ make -j$(nproc)
167
+ sudo make install
168
+ sudo ln -s /opt/pythondev/bin/python3 /opt/pythondev/bin/python
169
+ sudo ln -s /opt/pythondev/bin/pip3 /opt/pythondev/bin/pip
170
+ echo "/opt/pythondev/bin" >> $GITHUB_PATH
171
+ - uses : actions/setup-python@v5
172
+ if : ${{ !(matrix.debug_build || endsWith(matrix.python, '-dev')) }}
173
+ with :
174
+ python-version : ${{ matrix.python }}
175
+ architecture : ${{ matrix.arch }}
176
+
125
177
- name : Install tox
126
- run : pip install --upgrade 'setuptools!=50' tox==4.4.4
178
+ run : |
179
+ echo PATH; echo $PATH
180
+ echo which python; which python
181
+ echo which pip; which pip
182
+ echo python version; python -c 'import sys; print(sys.version)'
183
+ echo debug build; python -c 'import sysconfig; print(bool(sysconfig.get_config_var("Py_DEBUG")))'
184
+ echo os.cpu_count; python -c 'import os; print(os.cpu_count())'
185
+ echo os.sched_getaffinity; python -c 'import os; print(len(getattr(os, "sched_getaffinity", lambda *args: [])(0)))'
186
+ pip install setuptools==75.1.0 tox==4.21.2
187
+
127
188
- name : Compiled with mypyc
128
189
if : ${{ matrix.test_mypyc }}
129
190
run : |
130
191
pip install -r test-requirements.txt
131
192
CC=clang MYPYC_OPT_LEVEL=0 MYPY_USE_MYPYC=1 pip install -e .
193
+
132
194
- name : Setup tox environment
133
- run : tox run -e ${{ matrix.toxenv }} --notest
195
+ run : |
196
+ tox run -e ${{ matrix.toxenv }} --notest
134
197
- name : Test
135
198
run : tox run -e ${{ matrix.toxenv }} --skip-pkg-install -- ${{ matrix.tox_extra_args }}
199
+ continue-on-error : ${{ matrix.allow_failure == 'true' }}
136
200
137
- python-nightly :
138
- runs-on : ubuntu-latest
139
- name : Test suite with Python nightly
140
- steps :
141
- - uses : actions/checkout@v3
142
- - uses : actions/setup-python@v4
143
- with :
144
- python-version : ' 3.12-dev'
145
- - name : Install tox
146
- run : pip install --upgrade 'setuptools!=50' tox==4.4.4
147
- - name : Setup tox environment
148
- run : tox run -e py --notest
149
- - name : Test
150
- run : tox run -e py --skip-pkg-install -- "-n 2"
151
- continue-on-error : true
152
- - name : Mark as a success
153
- run : exit 0
201
+ - name : Mark as success (check failures manually)
202
+ if : ${{ matrix.allow_failure == 'true' }}
203
+ run : exit 0
154
204
155
205
python_32bits :
156
206
runs-on : ubuntu-latest
@@ -170,7 +220,7 @@ jobs:
170
220
CXX : i686-linux-gnu-g++
171
221
CC : i686-linux-gnu-gcc
172
222
steps :
173
- - uses : actions/checkout@v3
223
+ - uses : actions/checkout@v4
174
224
- name : Install 32-bit build dependencies
175
225
run : |
176
226
sudo dpkg --add-architecture i386 && \
@@ -193,8 +243,8 @@ jobs:
193
243
default : 3.11.1
194
244
command : python -c "import platform; print(f'{platform.architecture()=} {platform.machine()=}');"
195
245
- name : Install tox
196
- run : pip install --upgrade ' setuptools!=50' tox==4.4.4
246
+ run : pip install setuptools==75.1.0 tox==4.21.2
197
247
- name : Setup tox environment
198
248
run : tox run -e py --notest
199
249
- name : Test
200
- run : tox run -e py --skip-pkg-install -- -n 2 mypyc/test/
250
+ run : tox run -e py --skip-pkg-install -- -n 4 mypyc/test/
0 commit comments