loguru-mypy
loguru-mypy copied to clipboard
Support new mypy 1.0 version specifiers
Error:
[2023-03-06T13:50:00.891Z] Traceback (most recent call last):
[2023-03-06T13:50:00.891Z] File "/usr/app/.venv/bin/mypy", line 8, in <module>
[2023-03-06T13:50:00.891Z] sys.exit(console_entry())
[2023-03-06T13:50:00.891Z] File "/usr/app/.venv/lib/python3.10/site-packages/mypy/__main__.py", line 15, in console_entry
[2023-03-06T13:50:00.891Z] main()
[2023-03-06T13:50:00.891Z] File "mypy/main.py", line 95, in main
[2023-03-06T13:50:00.891Z] File "mypy/main.py", line 174, in run_build
[2023-03-06T13:50:00.891Z] File "mypy/build.py", line 194, in build
[2023-03-06T13:50:00.891Z] File "mypy/build.py", line 249, in _build
[2023-03-06T13:50:00.891Z] File "mypy/build.py", line 510, in load_plugins
[2023-03-06T13:50:00.891Z] File "mypy/build.py", line 474, in load_plugins_from_config
[2023-03-06T13:50:00.891Z] File "/usr/app/.venv/lib/python3.10/site-packages/loguru_mypy/__init__.py", line 246, in plugin
[2023-03-06T13:50:00.891Z] raise UnsupportedMypyVersion(version)
[2023-03-06T13:50:00.891Z] loguru_mypy.UnsupportedMypyVersion: Mypy 1.0.1 is not supported
If I look at the intent from the exception, it looks like this doesn't handle the fact that mypy changed the versioning structure, e.g. 1.0.1
:
https://github.com/kornicameister/loguru-mypy/blob/6598c234056dc4910b0a4288218b6012871b5477/loguru_mypy/init.py#L243-L247
So now the minor
version is resolved as 0
and this line fails.