Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support new mypy 1.0 version specifiers #184

Open
phillipuniverse opened this issue Mar 6, 2023 · 0 comments · May be fixed by #185
Open

Support new mypy 1.0 version specifiers #184

phillipuniverse opened this issue Mar 6, 2023 · 0 comments · May be fixed by #185

Comments

@phillipuniverse
Copy link

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.

phillipuniverse added a commit to phillipuniverse/loguru-mypy that referenced this issue Mar 6, 2023
@phillipuniverse phillipuniverse linked a pull request Mar 6, 2023 that will close this issue
phillipuniverse added a commit to phillipuniverse/loguru-mypy that referenced this issue Mar 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant