diff --git a/keyring/backend.py b/keyring/backend.py index 6c08a53a..79cf85db 100644 --- a/keyring/backend.py +++ b/keyring/backend.py @@ -94,12 +94,12 @@ def __str__(self): ) @abc.abstractmethod - def get_password(self, service, username) -> Optional[str]: + def get_password(self, service: str, username: str) -> Optional[str]: """Get password of the username for the service""" return None @abc.abstractmethod - def set_password(self, service, username, password): + def set_password(self, service: str, username: str, password: str) -> None: """Set password for the username of the service. If the backend cannot store passwords, raise @@ -110,7 +110,7 @@ def set_password(self, service, username, password): # for backward-compatibility, don't require a backend to implement # delete_password # @abc.abstractmethod - def delete_password(self, service, username): + def delete_password(self, service: str, username: str) -> None: """Delete the password for the username of the service. If the backend cannot delete passwords, raise @@ -122,7 +122,9 @@ def delete_password(self, service, username): # get_credential # @abc.abstractmethod def get_credential( - self, service, username + self, + service: str, + username: Optional[str], ) -> Optional[credentials.SimpleCredential]: """Gets the username and password for the service. Returns a Credential instance. diff --git a/keyring/backends/fail.py b/keyring/backends/fail.py index d0bfb161..179717a9 100644 --- a/keyring/backends/fail.py +++ b/keyring/backends/fail.py @@ -24,4 +24,4 @@ def get_password(self, service, username, password=None): ) raise NoKeyringError(msg) - set_password = delete_password = get_password + set_password = delete_password = get_password # type: ignore diff --git a/keyring/backends/null.py b/keyring/backends/null.py index 2e4bf080..6525c0ff 100644 --- a/keyring/backends/null.py +++ b/keyring/backends/null.py @@ -14,4 +14,4 @@ class Keyring(KeyringBackend): def get_password(self, service, username, password=None): pass - set_password = delete_password = get_password + set_password = delete_password = get_password # type: ignore