@@ -36,55 +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
7793 # TODO: macos-13 is the last one to support Python 3.9, change it to macos-latest when updating the Python version
7894 os : macos-13
7995 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
88107
89108 - name : Type check our own code (py38-ubuntu)
90109 python : ' 3.8'
@@ -109,8 +128,8 @@ jobs:
109128 name : ${{ matrix.name }}
110129 env :
111130 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 }}
114133 # Tox
115134 PY_COLORS : 1
116135 # Mypy (see https://github.com/python/mypy/issues/7771)
@@ -119,31 +138,69 @@ jobs:
119138 MYPY_FORCE_TERMINAL_WIDTH : 200
120139 # Pytest
121140 PYTEST_ADDOPTS : --color=yes
141+
122142 steps :
123143 - uses : actions/checkout@v4
124- - uses : actions/setup-python@v5
125- with :
126- python-version : ${{ matrix.python }}
127- architecture : ${{ matrix.arch }}
144+
128145 - name : Debug build
129146 if : ${{ matrix.debug_build }}
130147 run : |
131148 PYTHONVERSION=${{ matrix.python }}
132149 PYTHONDIR=~/python-debug/python-$PYTHONVERSION
133150 VENV=$PYTHONDIR/env
134151 ./misc/build-debug-python.sh $PYTHONVERSION $PYTHONDIR $VENV
152+ # TODO: does this do anything? env vars aren't passed to the next step right
135153 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+
136177 - 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+
138188 - name : Compiled with mypyc
139189 if : ${{ matrix.test_mypyc }}
140190 run : |
141191 pip install -r test-requirements.txt
142192 CC=clang MYPYC_OPT_LEVEL=0 MYPY_USE_MYPYC=1 pip install -e .
193+
143194 - name : Setup tox environment
144- run : tox run -e ${{ matrix.toxenv }} --notest
195+ run : |
196+ tox run -e ${{ matrix.toxenv }} --notest
145197 - name : Test
146198 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
147204
148205 python_32bits :
149206 runs-on : ubuntu-latest
@@ -186,8 +243,8 @@ jobs:
186243 default : 3.11.1
187244 command : python -c "import platform; print(f'{platform.architecture()=} {platform.machine()=}');"
188245 - 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
190247 - name : Setup tox environment
191248 run : tox run -e py --notest
192249 - 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