From 377f9b9ad225427779a6e1bcd1e1fad28606fb3e Mon Sep 17 00:00:00 2001 From: Phillip Verheyden Date: Mon, 6 Mar 2023 10:29:30 -0600 Subject: [PATCH] Support mypy > 1.0.0 Fixes #184 --- .github/workflows/ci.yml | 1 + loguru_mypy/__init__.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c5d9167..c523d20 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -87,6 +87,7 @@ jobs: - mypy==0.790 - mypy==0.800 - mypy==0.812 + - mypy==1.0.1 - -e git+https://github.com/python/mypy.git#egg=mypy steps: - uses: actions/checkout@v3 diff --git a/loguru_mypy/__init__.py b/loguru_mypy/__init__.py index 82c8a2a..6337601 100644 --- a/loguru_mypy/__init__.py +++ b/loguru_mypy/__init__.py @@ -241,7 +241,7 @@ def __init__(self, version: str) -> None: def plugin(version: str) -> t.Type[LoguruPlugin]: - minor = int(version.split('.')[1].replace('+dev', '')) - if minor < 770: + version_info = tuple(int(v.replace('+dev', '')) for v in version.split('.')) + if version_info < (0, 770): raise UnsupportedMypyVersion(version) return LoguruPlugin