From 1564ab5de65754e862ce08201eb0a2311b12a1ef Mon Sep 17 00:00:00 2001 From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Date: Fri, 8 May 2026 11:05:49 +0200 Subject: [PATCH 1/5] Start testing Python 3.15 --- .github/workflows/test.yml | 7 +++++++ tox.ini | 1 + 2 files changed, 8 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5242739f8f846..27fa756b7f607 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -59,6 +59,12 @@ jobs: toxenv: py tox_extra_args: "-n 4" test_mypyc: true + - name: Test suite with py315-ubuntu, mypyc-compiled + python: '3.15' + os: ubuntu-24.04-arm + toxenv: py + tox_extra_args: "-n 4" + test_mypyc: true - name: Test suite with py314t-ubuntu, mypyc-compiled python: '3.14t' os: ubuntu-24.04-arm @@ -196,6 +202,7 @@ jobs: if: ${{ !(matrix.debug_build || endsWith(matrix.python, '-dev')) }} with: python-version: ${{ matrix.python }} + allow-prereleases: true - name: Install tox run: | diff --git a/tox.ini b/tox.ini index 2126970afa991..ab81b00d121f5 100644 --- a/tox.ini +++ b/tox.ini @@ -7,6 +7,7 @@ envlist = py312, py313, py314, + py315, docs, lint, type, From edf85f85fd9224287830226eedf8c922e6c1ce50 Mon Sep 17 00:00:00 2001 From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Date: Fri, 8 May 2026 11:36:39 +0200 Subject: [PATCH 2/5] Update pygments pin --- test-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-requirements.txt b/test-requirements.txt index 8ac31e0b34666..204f10fec33b5 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -46,7 +46,7 @@ pre-commit==4.3.0 # via -r test-requirements.in psutil==7.1.0 # via -r test-requirements.in -pygments==2.19.2 +pygments==2.20.0 # via pytest pytest==8.4.2 # via From 93e993a6b5d77369e50c5c427ee0d32ad9bb6eb1 Mon Sep 17 00:00:00 2001 From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Date: Fri, 8 May 2026 11:33:20 +0200 Subject: [PATCH 3/5] Fix tests --- mypyc/test-data/run-misc.test | 5 ++++- mypyc/test-data/run-python312.test | 3 ++- mypyc/test/test_emit.py | 15 +++++++++++++-- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/mypyc/test-data/run-misc.test b/mypyc/test-data/run-misc.test index eda44e16871f2..d48884ada853a 100644 --- a/mypyc/test-data/run-misc.test +++ b/mypyc/test-data/run-misc.test @@ -971,7 +971,10 @@ print(z) [case testCheckVersion] import sys -if sys.version_info[:2] == (3, 15): +if sys.version_info[:2] == (3, 16): + def version() -> int: + return 16 +elif sys.version_info[:2] == (3, 15): def version() -> int: return 15 elif sys.version_info[:2] == (3, 14): diff --git a/mypyc/test-data/run-python312.test b/mypyc/test-data/run-python312.test index 5ed6dca9ecb28..f3dc272fc9fa1 100644 --- a/mypyc/test-data/run-python312.test +++ b/mypyc/test-data/run-python312.test @@ -229,9 +229,10 @@ type C[*Ts] = tuple[*Ts] def test_type_var_tuple_type_alias() -> None: if sys.version_info >= (3, 15): # type: ignore[operator] assert str(C[int, str]) == "_frozen_importlib.C[int, str]" + assert str(getattr(C, "__value__")) == "tuple[typing.Unpack[~Ts]]" else: assert str(C[int, str]) == "C[int, str]" - assert str(getattr(C, "__value__")) == "tuple[typing.Unpack[Ts]]" + assert str(getattr(C, "__value__")) == "tuple[typing.Unpack[Ts]]" type D[**P] = Callable[P, int] diff --git a/mypyc/test/test_emit.py b/mypyc/test/test_emit.py index 285488e03c9ae..bb829c4128132 100644 --- a/mypyc/test/test_emit.py +++ b/mypyc/test/test_emit.py @@ -1,5 +1,6 @@ from __future__ import annotations +import sys import unittest from mypyc.codegen.emit import Emitter, EmitterContext @@ -42,7 +43,12 @@ def test_reg(self) -> None: def test_object_annotation(self) -> None: assert self.emitter.object_annotation("hello, world", "line;") == " /* 'hello, world' */" - assert self.emitter.object_annotation(list(range(30)), "line;") == """\ + if sys.version_info >= (3, 15): + assert self.emitter.object_annotation(list(range(30)), "line;") == """\ + /* [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29] */""" + else: + assert self.emitter.object_annotation(list(range(30)), "line;") == """\ /* [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29] */""" @@ -57,7 +63,12 @@ def test_emit_line(self) -> None: emitter.emit_line("CPyStatics[0];", ann="hello, world") emitter.emit_line("CPyStatics[1];", ann=list(range(30))) assert emitter.fragments[0] == "CPyStatics[0]; /* 'hello, world' */\n" - assert emitter.fragments[1] == """\ + if sys.version_info >= (3, 15): + assert emitter.fragments[1] == """\ +CPyStatics[1]; /* [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29] */\n""" + else: + assert emitter.fragments[1] == """\ CPyStatics[1]; /* [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29] */\n""" From 65e8f663935d24c9c12de217076807ab77440b4f Mon Sep 17 00:00:00 2001 From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Date: Fri, 8 May 2026 11:57:53 +0200 Subject: [PATCH 4/5] Update tox --- .github/workflows/docs.yml | 2 +- .github/workflows/test.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 66e7c997f4fad..b8303342a254c 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -44,7 +44,7 @@ jobs: with: python-version: '3.12' - name: Install tox - run: pip install tox==4.26.0 + run: pip install tox==4.53.1 - name: Setup tox environment run: tox run -e ${{ env.TOXENV }} --notest - name: Test diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 27fa756b7f607..b06f181746c35 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -213,7 +213,7 @@ jobs: echo debug build; python -c 'import sysconfig; print(bool(sysconfig.get_config_var("Py_DEBUG")))' echo os.cpu_count; python -c 'import os; print(os.cpu_count())' echo os.sched_getaffinity; python -c 'import os; print(len(getattr(os, "sched_getaffinity", lambda *args: [])(0)))' - pip install tox==4.26.0 + pip install tox==4.53.1 - name: Compiled with mypyc if: ${{ matrix.test_mypyc }} @@ -278,7 +278,7 @@ jobs: default: 3.11.1 command: python -c "import platform; print(f'{platform.architecture()=} {platform.machine()=}');" - name: Install tox - run: pip install tox==4.26.0 + run: pip install tox==4.53.1 - name: Setup tox environment run: tox run -e py --notest - name: Test From 9c064038261e71aac3f36cf571984a9f081525a4 Mon Sep 17 00:00:00 2001 From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Date: Fri, 8 May 2026 12:09:49 +0200 Subject: [PATCH 5/5] Update packaging pin --- test-requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test-requirements.txt b/test-requirements.txt index 204f10fec33b5..462f42aa16e25 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -32,7 +32,7 @@ mypy-extensions==1.1.0 # via -r mypy-requirements.txt nodeenv==1.9.1 # via pre-commit -packaging==25.0 +packaging==26.2 # via pytest pathspec==1.0.0 # via -r mypy-requirements.txt