class TestKeyring(keyring.backend.KeyringBackend):
"""A test keyring which always outputs the same password
"""
priority = 1
If I set that in my custom backend class then mypy complains with an error.
class EnvvarsKeyring(KeyringBackend):
"""Pip Environment Credentials EnvvarsKeyring."""
priority = 1
src/keyrings/envvars/keyring.py:19: error: Incompatible types in assignment (expression has type "int", base class "KeyringBackend" defined the type as "Callable[[KeyringBackend], Union[int, float]]") [assignment]
src/keyrings/envvars/keyring.py:8: error: Skipping analyzing "jaraco.classes": found module but no type hints or library stubs [import]
src/keyrings/envvars/keyring.py:8: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
src/keyrings/envvars/keyring.py:58: error: Untyped decorator makes function "priority" untyped [misc]
src/keyrings/envvars/keyring.py:60: error: Function is untyped after decorator transformation [misc]
What is the recommendation here? Should the type signature of priority be changed? Or should I ignore the type errors on untyped jaraco.classes?
Describe the bug I'm looking at the readme https://github.com/jaraco/keyring#write-your-own-keyring-backend and it is showing in the example:
If I set that in my custom backend class then mypy complains with an error.
If I change the
priority = 1
to the following:then I see that everything is untyped:
What is the recommendation here? Should the type signature of
priority
be changed? Or should I ignore the type errors on untypedjaraco.classes
?