Skip to content

Commit

Permalink
ci(tox): mypy permanently fixated at 1.3 for stub testsuite
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
abelcheung committed Oct 25, 2023
1 parent f431f5e commit 2f06209
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 3 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand All @@ -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}

Expand Down

0 comments on commit 2f06209

Please sign in to comment.