Skip to content

Commit

Permalink
general: use typing annotations for icalendar and workalendart
Browse files Browse the repository at this point in the history
  • Loading branch information
karlicoss committed Feb 6, 2025
1 parent 27f8bcd commit ba4b5b6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/my/calendar/holidays.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

@lru_cache(1)
def _calendar():
from workalendar.registry import registry # type: ignore[import-not-found]
from workalendar.registry import registry

# todo switch to using time.tz.main once _get_tz stabilizes?
from ..time.tz import via_location as LTZ
Expand Down
7 changes: 3 additions & 4 deletions src/my/rtm.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@
from datetime import datetime
from functools import cached_property

# no mypy annotations... https://github.com/collective/icalendar/issues/395
import icalendar # type: ignore[import-not-found]
from icalendar.cal import Todo # type: ignore[import-not-found]
import icalendar
from icalendar.cal import Todo
from more_itertools import bucket

from my.core import get_files, make_logger
Expand Down Expand Up @@ -90,7 +89,7 @@ def __init__(self, data: str, revision=None) -> None:

def all_todos(self) -> Iterator[MyTodo]:
for t in self.cal.walk('VTODO'):
yield MyTodo(t, self.revision)
yield MyTodo(t, self.revision) # type: ignore[arg-type]

def get_todos_by_uid(self) -> dict[str, MyTodo]:
todos = self.all_todos()
Expand Down
10 changes: 6 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,12 @@ commands =
dependency_groups = testing
deps =
-e .[optional]
uv # for hpi module install
lxml-stubs # for my.smscalls
types-protobuf # for my.google.maps.android
types-Pillow # for my.photos
uv # for hpi module install
lxml-stubs # for my.smscalls
types-protobuf # for my.google.maps.android
types-Pillow # for my.photos
types-icalendar # for my.rtm
types-workalendar # for my.calendar.holidays
commands =
{envpython} -m my.core module install \
my.arbtt \
Expand Down

0 comments on commit ba4b5b6

Please sign in to comment.