Skip to content

Support new mypy 1.0 version specifiers #184

@phillipuniverse

Description

@phillipuniverse

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:

def plugin(version: str) -> t.Type[LoguruPlugin]:
minor = int(version.split('.')[1].replace('+dev', ''))
if minor < 770:
raise UnsupportedMypyVersion(version)
return LoguruPlugin

So now the minor version is resolved as 0 and this line fails.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions