70
70
toxenv : py
71
71
tox_extra_args : " -n 4"
72
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"
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
73
89
74
90
- name : mypyc runtime tests with py39-macos
75
91
python : ' 3.9.18'
@@ -78,13 +94,16 @@ jobs:
78
94
os : macos-13
79
95
toxenv : py
80
96
tox_extra_args : " -n 3 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 4 mypyc/test/test_run.py mypyc/test/test_external.py"
87
- debug_build : true
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'
@@ -107,10 +126,11 @@ jobs:
107
126
toxenv : lint
108
127
109
128
name : ${{ matrix.name }}
129
+ timeout-minutes : 60
110
130
env :
111
131
TOX_SKIP_MISSING_INTERPRETERS : False
112
- # Rich (pip)
113
- FORCE_COLOR : 1
132
+ # Rich (pip) -- Disable color for windows + pytest
133
+ FORCE_COLOR : ${{ !(startsWith(matrix.os, 'windows-') && startsWith(matrix.toxenv, 'py')) && 1 || 0 }}
114
134
# Tox
115
135
PY_COLORS : 1
116
136
# Mypy (see https://github.com/python/mypy/issues/7771)
@@ -119,37 +139,74 @@ jobs:
119
139
MYPY_FORCE_TERMINAL_WIDTH : 200
120
140
# Pytest
121
141
PYTEST_ADDOPTS : --color=yes
142
+
122
143
steps :
123
144
- uses : actions/checkout@v4
124
- - uses : actions/setup-python@v5
125
- with :
126
- python-version : ${{ matrix.python }}
127
- architecture : ${{ matrix.arch }}
145
+
128
146
- name : Debug build
129
147
if : ${{ matrix.debug_build }}
130
148
run : |
131
149
PYTHONVERSION=${{ matrix.python }}
132
150
PYTHONDIR=~/python-debug/python-$PYTHONVERSION
133
151
VENV=$PYTHONDIR/env
134
152
./misc/build-debug-python.sh $PYTHONVERSION $PYTHONDIR $VENV
153
+ # TODO: does this do anything? env vars aren't passed to the next step right
135
154
source $VENV/bin/activate
155
+ - name : Latest dev build
156
+ if : ${{ endsWith(matrix.python, '-dev') }}
157
+ run : |
158
+ git clone --depth 1 https://github.com/python/cpython.git /tmp/cpython --branch $( echo ${{ matrix.python }} | sed 's/-dev//' )
159
+ cd /tmp/cpython
160
+ echo git rev-parse HEAD; git rev-parse HEAD
161
+ git show --no-patch
162
+ sudo apt-get update
163
+ sudo apt-get install -y --no-install-recommends \
164
+ build-essential gdb lcov libbz2-dev libffi-dev libgdbm-dev liblzma-dev libncurses5-dev \
165
+ libreadline6-dev libsqlite3-dev libssl-dev lzma lzma-dev tk-dev uuid-dev zlib1g-dev
166
+ ./configure --prefix=/opt/pythondev
167
+ make -j$(nproc)
168
+ sudo make install
169
+ sudo ln -s /opt/pythondev/bin/python3 /opt/pythondev/bin/python
170
+ sudo ln -s /opt/pythondev/bin/pip3 /opt/pythondev/bin/pip
171
+ echo "/opt/pythondev/bin" >> $GITHUB_PATH
172
+ - uses : actions/setup-python@v5
173
+ if : ${{ !(matrix.debug_build || endsWith(matrix.python, '-dev')) }}
174
+ with :
175
+ python-version : ${{ matrix.python }}
176
+ architecture : ${{ matrix.arch }}
177
+
136
178
- name : Install tox
137
- run : pip install setuptools==68.2.2 tox==4.11.0
179
+ run : |
180
+ echo PATH; echo $PATH
181
+ echo which python; which python
182
+ echo which pip; which pip
183
+ echo python version; python -c 'import sys; print(sys.version)'
184
+ echo debug build; python -c 'import sysconfig; print(bool(sysconfig.get_config_var("Py_DEBUG")))'
185
+ echo os.cpu_count; python -c 'import os; print(os.cpu_count())'
186
+ echo os.sched_getaffinity; python -c 'import os; print(len(getattr(os, "sched_getaffinity", lambda *args: [])(0)))'
187
+ pip install setuptools==75.1.0 tox==4.21.2
188
+
138
189
- name : Compiled with mypyc
139
190
if : ${{ matrix.test_mypyc }}
140
191
run : |
141
192
pip install -r test-requirements.txt
142
193
CC=clang MYPYC_OPT_LEVEL=0 MYPY_USE_MYPYC=1 pip install -e .
194
+
143
195
- name : Setup tox environment
144
196
run : |
145
197
tox run -e ${{ matrix.toxenv }} --notest
146
- python -c 'import os; print("os.cpu_count", os.cpu_count(), "os.sched_getaffinity", len(getattr(os, "sched_getaffinity", lambda *args: [])(0)))'
147
198
- name : Test
148
199
run : tox run -e ${{ matrix.toxenv }} --skip-pkg-install -- ${{ matrix.tox_extra_args }}
200
+ continue-on-error : ${{ matrix.allow_failure == 'true' }}
201
+
202
+ - name : Mark as success (check failures manually)
203
+ if : ${{ matrix.allow_failure == 'true' }}
204
+ run : exit 0
149
205
150
206
python_32bits :
151
207
runs-on : ubuntu-latest
152
208
name : Test mypyc suite with 32-bit Python
209
+ timeout-minutes : 60
153
210
env :
154
211
TOX_SKIP_MISSING_INTERPRETERS : False
155
212
# Rich (pip)
@@ -188,7 +245,7 @@ jobs:
188
245
default : 3.11.1
189
246
command : python -c "import platform; print(f'{platform.architecture()=} {platform.machine()=}');"
190
247
- name : Install tox
191
- run : pip install setuptools==68.2.2 tox==4.11.0
248
+ run : pip install setuptools==75.1.0 tox==4.21.2
192
249
- name : Setup tox environment
193
250
run : tox run -e py --notest
194
251
- name : Test
0 commit comments