From 730b83c2014ce9fafe0ae121f6160f409936dbe7 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sat, 1 Aug 2026 10:51:15 +0000 Subject: [PATCH] Pin mypy to <2 on PyPy 3.10 and older The build of `ast-serialize` (v0.6.0) fails on PyPy 3.10 because the underlying PyO3 library (v0.28.2) requires PyPy 3.11+. Since mypy 2+ requires `ast-serialize`, we cannot build or install modern mypy under PyPy 3.10. To address this, we conditionally pin `mypy` to `<2` under PyPy when the Python version is lower than `3.11`. For CPython and PyPy >= 3.11, we allow modern mypy. Co-authored-by: nhairs <9976336+nhairs@users.noreply.github.com> --- pyproject.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 86b89d9..5a3e459 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,7 +48,8 @@ dev = [ "validate-pyproject[all]", "black", "pylint", - "mypy", + "mypy<2; implementation_name == 'pypy' and python_version < '3.11'", + "mypy; implementation_name != 'pypy' or python_version >= '3.11'", ## Test "pytest", "freezegun",