summaryrefslogtreecommitdiff
path: root/jwt/help.py
diff options
context:
space:
mode:
authorJulian Maurin <julian.maurin.perso@pm.me>2022-08-03 06:28:10 +0200
committerGitHub <noreply@github.com>2022-08-03 10:28:10 +0600
commitf827be366cc2560266a412697b5194ee4782b510 (patch)
tree1cbac899d121c45fb2e0fb7a9256e381c0a714a1 /jwt/help.py
parente8780abdd561963e3b0ca49ecec8b8519a793f75 (diff)
downloadpyjwt-f827be366cc2560266a412697b5194ee4782b510.tar.gz
Mypy as pre-commit check + api_jws typing (#787)
* feat(mypy): from tox to pre-commit * fix(mypy): apply mypy fixes * feat(api_jws): typing Co-authored-by: JulianMaurin <julian.maurin@backmarket.com>
Diffstat (limited to 'jwt/help.py')
-rw-r--r--jwt/help.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/jwt/help.py b/jwt/help.py
index 767c323..0c02eb9 100644
--- a/jwt/help.py
+++ b/jwt/help.py
@@ -8,7 +8,7 @@ from . import __version__ as pyjwt_version
try:
import cryptography
except ModuleNotFoundError:
- cryptography = None # type: ignore
+ cryptography = None
def info() -> Dict[str, Dict[str, str]]:
@@ -29,14 +29,15 @@ def info() -> Dict[str, Dict[str, str]]:
if implementation == "CPython":
implementation_version = platform.python_version()
elif implementation == "PyPy":
+ pypy_version_info = getattr(sys, "pypy_version_info")
implementation_version = (
- f"{sys.pypy_version_info.major}." # type: ignore[attr-defined]
- f"{sys.pypy_version_info.minor}."
- f"{sys.pypy_version_info.micro}"
+ f"{pypy_version_info.major}."
+ f"{pypy_version_info.minor}."
+ f"{pypy_version_info.micro}"
)
- if sys.pypy_version_info.releaselevel != "final": # type: ignore[attr-defined]
+ if pypy_version_info.releaselevel != "final":
implementation_version = "".join(
- [implementation_version, sys.pypy_version_info.releaselevel] # type: ignore[attr-defined]
+ [implementation_version, pypy_version_info.releaselevel]
)
else:
implementation_version = "Unknown"