@@ -36,55 +36,74 @@ jobs:
36
36
arch : x64
37
37
os : ubuntu-latest
38
38
toxenv : py
39
- tox_extra_args : " -n 2 "
39
+ tox_extra_args : " -n 4 "
40
40
test_mypyc : true
41
41
- name : Test suite with py38-windows-64
42
42
python : ' 3.8'
43
43
arch : x64
44
44
os : windows-latest
45
45
toxenv : py38
46
- tox_extra_args : " -n 2 "
46
+ tox_extra_args : " -n 4 "
47
47
- name : Test suite with py39-ubuntu
48
48
python : ' 3.9'
49
49
arch : x64
50
50
os : ubuntu-latest
51
51
toxenv : py
52
- tox_extra_args : " -n 2 "
52
+ tox_extra_args : " -n 4 "
53
53
- name : Test suite with py310-ubuntu
54
54
python : ' 3.10'
55
55
arch : x64
56
56
os : ubuntu-latest
57
57
toxenv : py
58
- tox_extra_args : " -n 2 "
58
+ tox_extra_args : " -n 4 "
59
59
- name : Test suite with py311-ubuntu, mypyc-compiled
60
60
python : ' 3.11'
61
61
arch : x64
62
62
os : ubuntu-latest
63
63
toxenv : py
64
- tox_extra_args : " -n 2 "
64
+ tox_extra_args : " -n 4 "
65
65
test_mypyc : true
66
66
- name : Test suite with py312-ubuntu, mypyc-compiled
67
67
python : ' 3.12'
68
68
arch : x64
69
69
os : ubuntu-latest
70
70
toxenv : py
71
- tox_extra_args : " -n 2"
71
+ tox_extra_args : " -n 4"
72
+ test_mypyc : true
73
+ - name : Test suite with py313-ubuntu, mypyc-compiled
74
+ python : ' 3.13'
75
+ arch : x64
76
+ os : ubuntu-latest
77
+ toxenv : py
78
+ tox_extra_args : " -n 4"
72
79
test_mypyc : true
73
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
+
74
90
- name : mypyc runtime tests with py39-macos
75
91
python : ' 3.9.18'
76
92
arch : x64
77
93
# TODO: macos-13 is the last one to support Python 3.9, change it to macos-latest when updating the Python version
78
94
os : macos-13
79
95
toxenv : py
80
- tox_extra_args : " -n 2 mypyc/test/test_run.py mypyc/test/test_external.py"
81
- - name : mypyc runtime tests with py38-debug-build-ubuntu
82
- python : ' 3.8.17'
83
- arch : x64
84
- os : ubuntu-latest
85
- toxenv : py
86
- tox_extra_args : " -n 2 mypyc/test/test_run.py mypyc/test/test_external.py"
87
- debug_build : true
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
88
107
89
108
- name : Type check our own code (py38-ubuntu)
90
109
python : ' 3.8'
@@ -109,8 +128,8 @@ jobs:
109
128
name : ${{ matrix.name }}
110
129
env :
111
130
TOX_SKIP_MISSING_INTERPRETERS : False
112
- # Rich (pip)
113
- FORCE_COLOR : 1
131
+ # Rich (pip) -- Disable color for windows + pytest
132
+ FORCE_COLOR : ${{ !(startsWith(matrix.os, 'windows-') && startsWith(matrix.toxenv, 'py')) && 1 || 0 }}
114
133
# Tox
115
134
PY_COLORS : 1
116
135
# Mypy (see https://github.com/python/mypy/issues/7771)
@@ -119,31 +138,69 @@ jobs:
119
138
MYPY_FORCE_TERMINAL_WIDTH : 200
120
139
# Pytest
121
140
PYTEST_ADDOPTS : --color=yes
141
+
122
142
steps :
123
143
- uses : actions/checkout@v4
124
- - uses : actions/setup-python@v5
125
- with :
126
- python-version : ${{ matrix.python }}
127
- architecture : ${{ matrix.arch }}
144
+
128
145
- name : Debug build
129
146
if : ${{ matrix.debug_build }}
130
147
run : |
131
148
PYTHONVERSION=${{ matrix.python }}
132
149
PYTHONDIR=~/python-debug/python-$PYTHONVERSION
133
150
VENV=$PYTHONDIR/env
134
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
135
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
+
136
177
- name : Install tox
137
- run : pip install setuptools==68.2.2 tox==4.11.0
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
+
138
188
- name : Compiled with mypyc
139
189
if : ${{ matrix.test_mypyc }}
140
190
run : |
141
191
pip install -r test-requirements.txt
142
192
CC=clang MYPYC_OPT_LEVEL=0 MYPY_USE_MYPYC=1 pip install -e .
193
+
143
194
- name : Setup tox environment
144
- run : tox run -e ${{ matrix.toxenv }} --notest
195
+ run : |
196
+ tox run -e ${{ matrix.toxenv }} --notest
145
197
- name : Test
146
198
run : tox run -e ${{ matrix.toxenv }} --skip-pkg-install -- ${{ matrix.tox_extra_args }}
199
+ continue-on-error : ${{ matrix.allow_failure == 'true' }}
200
+
201
+ - name : Mark as success (check failures manually)
202
+ if : ${{ matrix.allow_failure == 'true' }}
203
+ run : exit 0
147
204
148
205
python_32bits :
149
206
runs-on : ubuntu-latest
@@ -186,8 +243,8 @@ jobs:
186
243
default : 3.11.1
187
244
command : python -c "import platform; print(f'{platform.architecture()=} {platform.machine()=}');"
188
245
- name : Install tox
189
- run : pip install setuptools==68.2.2 tox==4.11.0
246
+ run : pip install setuptools==75.1.0 tox==4.21.2
190
247
- name : Setup tox environment
191
248
run : tox run -e py --notest
192
249
- name : Test
193
- 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