7070 toxenv : py
7171 tox_extra_args : " -n 4"
7272 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
7389
7490 - name : mypyc runtime tests with py39-macos
7591 python : ' 3.9.18'
@@ -78,13 +94,16 @@ jobs:
7894 os : macos-13
7995 toxenv : py
8096 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
88107
89108 - name : Type check our own code (py38-ubuntu)
90109 python : ' 3.8'
@@ -107,10 +126,11 @@ jobs:
107126 toxenv : lint
108127
109128 name : ${{ matrix.name }}
129+ timeout-minutes : 60
110130 env :
111131 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 }}
114134 # Tox
115135 PY_COLORS : 1
116136 # Mypy (see https://github.com/python/mypy/issues/7771)
@@ -119,37 +139,74 @@ jobs:
119139 MYPY_FORCE_TERMINAL_WIDTH : 200
120140 # Pytest
121141 PYTEST_ADDOPTS : --color=yes
142+
122143 steps :
123144 - uses : actions/checkout@v4
124- - uses : actions/setup-python@v5
125- with :
126- python-version : ${{ matrix.python }}
127- architecture : ${{ matrix.arch }}
145+
128146 - name : Debug build
129147 if : ${{ matrix.debug_build }}
130148 run : |
131149 PYTHONVERSION=${{ matrix.python }}
132150 PYTHONDIR=~/python-debug/python-$PYTHONVERSION
133151 VENV=$PYTHONDIR/env
134152 ./misc/build-debug-python.sh $PYTHONVERSION $PYTHONDIR $VENV
153+ # TODO: does this do anything? env vars aren't passed to the next step right
135154 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+
136178 - 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+
138189 - name : Compiled with mypyc
139190 if : ${{ matrix.test_mypyc }}
140191 run : |
141192 pip install -r test-requirements.txt
142193 CC=clang MYPYC_OPT_LEVEL=0 MYPY_USE_MYPYC=1 pip install -e .
194+
143195 - name : Setup tox environment
144196 run : |
145197 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)))'
147198 - name : Test
148199 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
149205
150206 python_32bits :
151207 runs-on : ubuntu-latest
152208 name : Test mypyc suite with 32-bit Python
209+ timeout-minutes : 60
153210 env :
154211 TOX_SKIP_MISSING_INTERPRETERS : False
155212 # Rich (pip)
@@ -188,7 +245,7 @@ jobs:
188245 default : 3.11.1
189246 command : python -c "import platform; print(f'{platform.architecture()=} {platform.machine()=}');"
190247 - 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
192249 - name : Setup tox environment
193250 run : tox run -e py --notest
194251 - name : Test
0 commit comments