9494 # This is broken. See
9595 # - https://github.com/python/mypy/issues/17819
9696 # - https://github.com/python/mypy/pull/17822
97- # - name: mypyc runtime tests with py38 -debug-build-ubuntu
98- # python: '3.9.21 '
97+ # - name: mypyc runtime tests with py310 -debug-build-ubuntu
98+ # python: '3.10 '
9999 # os: ubuntu-latest
100100 # toxenv: py
101101 # tox_extra_args: "-n 4 mypyc/test/test_run.py mypyc/test/test_external.py"
@@ -106,12 +106,20 @@ jobs:
106106 os : ubuntu-24.04-arm
107107 toxenv : py
108108 tox_extra_args : " -n 4 --mypy-num-workers=4 mypy/test/testcheck.py"
109+ dev_ast_serialize : true
109110 - name : Parallel tests with py314-ubuntu, mypyc-compiled
110111 python : ' 3.14'
111112 os : ubuntu-24.04-arm
112113 toxenv : py
113114 tox_extra_args : " -n 4 --mypy-num-workers=4 mypy/test/testcheck.py"
114115 test_mypyc : true
116+ dev_ast_serialize : true
117+ # Skip Windows tests until we publish ast_serialize wheels on PyPI.
118+ # - name: Parallel tests with py314-windows-64, interpreted
119+ # python: '3.14'
120+ # os: windows-latest
121+ # toxenv: py
122+ # tox_extra_args: "-n 2 --mypy-num-workers=2 mypy/test/testcheck.py -k 'incremental or modules or classes'"
115123
116124 - name : Type check our own code (py310-ubuntu)
117125 python : ' 3.10'
@@ -134,6 +142,7 @@ jobs:
134142 timeout-minutes : 60
135143 env :
136144 TOX_SKIP_MISSING_INTERPRETERS : False
145+ VIRTUALENV_SYSTEM_SITE_PACKAGES : ${{ matrix.dev_ast_serialize && 1 || 0 }}
137146 # Rich (pip) -- Disable color for windows + pytest
138147 FORCE_COLOR : ${{ !(startsWith(matrix.os, 'windows-') && startsWith(matrix.toxenv, 'py')) && 1 || 0 }}
139148 # Tox
@@ -152,24 +161,15 @@ jobs:
152161 with :
153162 persist-credentials : false
154163
155- - name : Debug build
156- if : ${{ matrix.debug_build }}
157- run : |
158- PYTHONVERSION=${{ matrix.python }}
159- PYTHONDIR=~/python-debug/python-$PYTHONVERSION
160- VENV=$PYTHONDIR/env
161- ./misc/build-debug-python.sh $PYTHONVERSION $PYTHONDIR $VENV
162- # TODO: does this do anything? env vars aren't passed to the next step right
163- source $VENV/bin/activate
164164 - name : Latest dev build
165165 if : ${{ endsWith(matrix.python, '-dev') }}
166166 run : |
167167 git clone --depth 1 https://github.com/python/cpython.git /tmp/cpython --branch $( echo ${{ matrix.python }} | sed 's/-dev//' )
168168 cd /tmp/cpython
169169 echo git rev-parse HEAD; git rev-parse HEAD
170170 git show --no-patch
171- sudo apt-get update
172- sudo apt-get install -y --no-install-recommends \
171+ sudo apt-get update -q
172+ sudo apt-get install -q - y --no-install-recommends \
173173 build-essential gdb lcov libbz2-dev libffi-dev libgdbm-dev liblzma-dev libncurses5-dev \
174174 libreadline6-dev libsqlite3-dev libssl-dev lzma lzma-dev tk-dev uuid-dev zlib1g-dev
175175 ./configure --prefix=/opt/pythondev
@@ -178,6 +178,23 @@ jobs:
178178 sudo ln -s /opt/pythondev/bin/python3 /opt/pythondev/bin/python
179179 sudo ln -s /opt/pythondev/bin/pip3 /opt/pythondev/bin/pip
180180 echo "/opt/pythondev/bin" >> $GITHUB_PATH
181+ - name : Debug build
182+ if : ${{ matrix.debug_build }}
183+ run : |
184+ git clone --depth 1 https://github.com/python/cpython.git /tmp/cpython --branch ${{ matrix.python }}
185+ cd /tmp/cpython
186+ echo git rev-parse HEAD; git rev-parse HEAD
187+ git show --no-patch
188+ sudo apt-get update -q
189+ sudo apt-get install -q -y --no-install-recommends \
190+ build-essential gdb lcov libbz2-dev libffi-dev libgdbm-dev liblzma-dev libncurses5-dev \
191+ libreadline6-dev libsqlite3-dev libssl-dev lzma lzma-dev tk-dev uuid-dev zlib1g-dev
192+ ./configure CFLAGS="-DPy_DEBUG -DPy_TRACE_REFS -DPYMALLOC_DEBUG" --with-pydebug -with-trace-refs --prefix=/opt/pythondev
193+ make -j$(nproc)
194+ sudo make install
195+ sudo ln -s /opt/pythondev/bin/python3 /opt/pythondev/bin/python
196+ sudo ln -s /opt/pythondev/bin/pip3 /opt/pythondev/bin/pip
197+ echo "/opt/pythondev/bin" >> $GITHUB_PATH
181198 - uses : actions/setup-python@v5
182199 if : ${{ !(matrix.debug_build || endsWith(matrix.python, '-dev')) }}
183200 with :
@@ -200,6 +217,30 @@ jobs:
200217 pip install -r test-requirements.txt
201218 CC=clang MYPYC_OPT_LEVEL=0 MYPY_USE_MYPYC=1 pip install -e .
202219
220+ # To speed-up process until ast_serialize is on PyPI.
221+ - name : Checkout pinned ast_serialize
222+ if : ${{ matrix.dev_ast_serialize }}
223+ uses : actions/checkout@v4
224+ with :
225+ persist-credentials : false
226+ repository : mypyc/ast_serialize
227+ ref : da5a16cf268dbec63ed6b2e6b715470576e2d1a6
228+ path : ast_serialize
229+
230+ - if : ${{ matrix.dev_ast_serialize }}
231+ uses : PyO3/maturin-action@v1
232+ with :
233+ target : aarch64
234+ args : --release --out dist
235+ working-directory : ast_serialize
236+
237+ - if : ${{ matrix.dev_ast_serialize }}
238+ run : |
239+ pip install ast_serialize/dist/ast_serialize-0.1.0-cp39-abi3-manylinux_2_34_aarch64.whl
240+ echo 'no way' > test_ast_serialize.py
241+ python3 -c 'import ast_serialize; print(ast_serialize.parse("test_ast_serialize.py")[1])'
242+ rm test_ast_serialize.py
243+
203244 - name : Setup tox environment
204245 run : |
205246 tox run -e ${{ matrix.toxenv }} --notest
0 commit comments