@@ -36,54 +36,74 @@ jobs:
3636 arch : x64
3737 os : ubuntu-latest
3838 toxenv : py
39- tox_extra_args : " -n 2 "
39+ tox_extra_args : " -n 4 "
4040 test_mypyc : true
4141 - name : Test suite with py38-windows-64
4242 python : ' 3.8'
4343 arch : x64
4444 os : windows-latest
4545 toxenv : py38
46- tox_extra_args : " -n 2 "
46+ tox_extra_args : " -n 4 "
4747 - name : Test suite with py39-ubuntu
4848 python : ' 3.9'
4949 arch : x64
5050 os : ubuntu-latest
5151 toxenv : py
52- tox_extra_args : " -n 2 "
52+ tox_extra_args : " -n 4 "
5353 - name : Test suite with py310-ubuntu
5454 python : ' 3.10'
5555 arch : x64
5656 os : ubuntu-latest
5757 toxenv : py
58- tox_extra_args : " -n 2 "
58+ tox_extra_args : " -n 4 "
5959 - name : Test suite with py311-ubuntu, mypyc-compiled
6060 python : ' 3.11'
6161 arch : x64
6262 os : ubuntu-latest
6363 toxenv : py
64- tox_extra_args : " -n 2 "
64+ tox_extra_args : " -n 4 "
6565 test_mypyc : true
6666 - name : Test suite with py312-ubuntu, mypyc-compiled
6767 python : ' 3.12'
6868 arch : x64
6969 os : ubuntu-latest
7070 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"
7279 test_mypyc : true
7380
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+
7490 - name : mypyc runtime tests with py39-macos
7591 python : ' 3.9.18'
7692 arch : x64
77- os : macos-latest
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
7895 toxenv : py
79- tox_extra_args : " -n 2 mypyc/test/test_run.py mypyc/test/test_external.py"
80- - name : mypyc runtime tests with py38-debug-build-ubuntu
81- python : ' 3.8.17'
82- arch : x64
83- os : ubuntu-latest
84- toxenv : py
85- tox_extra_args : " -n 2 mypyc/test/test_run.py mypyc/test/test_external.py"
86- 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
87107
88108 - name : Type check our own code (py38-ubuntu)
89109 python : ' 3.8'
@@ -106,10 +126,11 @@ jobs:
106126 toxenv : lint
107127
108128 name : ${{ matrix.name }}
129+ timeout-minutes : 60
109130 env :
110131 TOX_SKIP_MISSING_INTERPRETERS : False
111- # Rich (pip)
112- FORCE_COLOR : 1
132+ # Rich (pip) -- Disable color for windows + pytest
133+ FORCE_COLOR : ${{ !(startsWith(matrix.os, 'windows-') && startsWith(matrix.toxenv, 'py')) && 1 || 0 }}
113134 # Tox
114135 PY_COLORS : 1
115136 # Mypy (see https://github.com/python/mypy/issues/7771)
@@ -118,35 +139,74 @@ jobs:
118139 MYPY_FORCE_TERMINAL_WIDTH : 200
119140 # Pytest
120141 PYTEST_ADDOPTS : --color=yes
142+
121143 steps :
122144 - uses : actions/checkout@v4
123- - uses : actions/setup-python@v4
124- with :
125- python-version : ${{ matrix.python }}
126- architecture : ${{ matrix.arch }}
145+
127146 - name : Debug build
128147 if : ${{ matrix.debug_build }}
129148 run : |
130149 PYTHONVERSION=${{ matrix.python }}
131150 PYTHONDIR=~/python-debug/python-$PYTHONVERSION
132151 VENV=$PYTHONDIR/env
133152 ./misc/build-debug-python.sh $PYTHONVERSION $PYTHONDIR $VENV
153+ # TODO: does this do anything? env vars aren't passed to the next step right
134154 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+
135178 - name : Install tox
136- 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+
137189 - name : Compiled with mypyc
138190 if : ${{ matrix.test_mypyc }}
139191 run : |
140192 pip install -r test-requirements.txt
141193 CC=clang MYPYC_OPT_LEVEL=0 MYPY_USE_MYPYC=1 pip install -e .
194+
142195 - name : Setup tox environment
143- run : tox run -e ${{ matrix.toxenv }} --notest
196+ run : |
197+ tox run -e ${{ matrix.toxenv }} --notest
144198 - name : Test
145199 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
146205
147206 python_32bits :
148207 runs-on : ubuntu-latest
149208 name : Test mypyc suite with 32-bit Python
209+ timeout-minutes : 60
150210 env :
151211 TOX_SKIP_MISSING_INTERPRETERS : False
152212 # Rich (pip)
@@ -185,8 +245,8 @@ jobs:
185245 default : 3.11.1
186246 command : python -c "import platform; print(f'{platform.architecture()=} {platform.machine()=}');"
187247 - name : Install tox
188- run : pip install setuptools==68.2.2 tox==4.11.0
248+ run : pip install setuptools==75.1.0 tox==4.21.2
189249 - name : Setup tox environment
190250 run : tox run -e py --notest
191251 - name : Test
192- run : tox run -e py --skip-pkg-install -- -n 2 mypyc/test/
252+ run : tox run -e py --skip-pkg-install -- -n 4 mypyc/test/
0 commit comments