From 2f06209c922d26d454a7dfa4373d0c1d80b24c21 Mon Sep 17 00:00:00 2001 From: Abel Cheung Date: Wed, 25 Oct 2023 15:48:34 +0000 Subject: [PATCH] ci(tox): mypy permanently fixated at 1.3 for stub testsuite Multiple problems with mypy / pytest-mypy-plugin interaction: - Starting from mypy 1.4, output is dependant on python version by default, test suite fails for python < 3.10 unless conditional file tests are used - 'python_version' mypy setting not honored (typeddjango/pytest-mypy-plugins#47) - Even if above bug is fixed, it's impossible to upgrade because jinja2 doesn't support all chevron template, test suite needs substantial changes OTOH, annotation itself is compatible with mypy 1.5 (not 1.6 tho) --- .github/workflows/pr.yml | 2 +- tox.ini | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 3cfc40e..ebe5141 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -35,7 +35,7 @@ jobs: workdir: lxml-stubs fail_on_error: true ignore_note: true - setup_command: pip install mypy>=1.1,<1.4 + setup_command: pip install mypy==1.5.1 setup_method: install install_types: false diff --git a/tox.ini b/tox.ini index 32f045e..efa67c8 100644 --- a/tox.ini +++ b/tox.ini @@ -18,7 +18,8 @@ deps = [testenv:py{38,39,310,311,312}-stub] deps = - {[testenv:mypy]deps} + {[common_dep]deps} + mypy == 1.3.0 pytest-mypy-plugins ~= 1.10, != 1.10.0 commands = pytest {posargs:test-stub} @@ -44,7 +45,7 @@ commands = [testenv:mypy] deps = {[common_dep]deps} - mypy >= 1.2, < 1.4 + mypy >= 1.2, < 1.6 package = skip commands = mypy {posargs:lxml-stubs}