Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,7 @@ jobs:
POETRY_VIRTUALENVS_CREATE: false
- name: Check formatting and linting
run: poetry run ruff check
- name: Static type checking
run: poetry run mypy pydpkg/
- name: Test with pytest
run: poetry run pytest tests/
297 changes: 191 additions & 106 deletions poetry.lock

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions pydpkg/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@
Base class to avoid pylint complaining about duplicate code
"""

from __future__ import annotations

from typing import Any


class _Dbase:
# pylint: disable=too-few-public-methods
def __getitem__(self, item):
def __getitem__(self, item: str) -> Any:
"""Overload getitem to treat the message plus our local
properties as items.

Expand All @@ -17,6 +21,6 @@ def __getitem__(self, item):
return getattr(self, item)
except AttributeError:
try:
return self.__getattr__(item)
return self.__getattr__(item) # type: ignore[attr-defined]
except AttributeError as ex:
raise KeyError(item) from ex
Loading