Skip to content

Commit

Permalink
🧎‍♀️ Genuflect to the types.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Aug 22, 2024
1 parent 5cd3828 commit ccdb048
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion keyring/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def name(cls) -> str:
"""
parent, sep, mod_name = cls.__module__.rpartition('.')
mod_name = mod_name.replace('_', ' ')
return ' '.join([mod_name, cls.__name__]) # type: ignore
return ' '.join([mod_name, cls.__name__]) # type: ignore[attr-defined]

def __str__(self) -> str:
keyring_class = type(self)
Expand Down
2 changes: 1 addition & 1 deletion keyring/backends/fail.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ def get_password(self, service, username, password=None):
)
raise NoKeyringError(msg)

set_password = delete_password = get_password # type: ignore
set_password = delete_password = get_password
2 changes: 1 addition & 1 deletion keyring/backends/libsecret.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def schema(self):
),
)

@properties.NonDataProperty # type: ignore
@properties.NonDataProperty
def collection(self):
return Secret.COLLECTION_DEFAULT

Expand Down
2 changes: 1 addition & 1 deletion keyring/backends/null.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ def priority(cls) -> float:
def get_password(self, service, username, password=None):
pass

set_password = delete_password = get_password # type: ignore
set_password = delete_password = get_password
4 changes: 2 additions & 2 deletions keyring/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@ def _emit_plain(self, credential: credentials.Credential):
print(credential.password)

def _get_creds(self) -> credentials.Credential | None:
return get_credential(self.service, self.username) # type: ignore
return get_credential(self.service, self.username) # type: ignore[attr-defined]

def _get_password(self) -> credentials.Credential | None:
password = get_password(self.service, self.username) # type: ignore
password = get_password(self.service, self.username) # type: ignore[attr-defined]
return (
credentials.SimpleCredential(None, password)
if password is not None
Expand Down
2 changes: 1 addition & 1 deletion keyring/compat/py312.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
if sys.version_info > (3, 12):
import importlib.metadata as metadata
else:
import importlib_metadata as metadata # type: ignore
import importlib_metadata as metadata # type: ignore[import-not-found, unused-ignore]
2 changes: 1 addition & 1 deletion keyring/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def _detect_backend(limit: typing.Optional[LimitCallable] = None):
or load_config()
or max(
# all keyrings passing the limit filter
filter(limit, backend.get_all_keyring()), # type: ignore # 659
filter(limit, backend.get_all_keyring()), # type: ignore[arg-type] # 659
default=fail.Keyring(),
key=backend.by_priority,
)
Expand Down

0 comments on commit ccdb048

Please sign in to comment.