Skip to content

Commit

Permalink
Merge pull request #320 from JohnStrunk/watchdog-types
Browse files Browse the repository at this point in the history
Update watchdog to v3
  • Loading branch information
mergify[bot] authored Aug 13, 2023
2 parents 283165e + 5c5addd commit 79a7517
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 34 deletions.
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ python-dateutil = "*"
requests = "*"
semver = "*"
ttkwidgets = "*"
watchdog = "<3.0.0" # 3.0.0 has broken type info
watchdog = "*"
DateTime = "*"
Pillow = "*"
PyChromecast = ">=13.0.5" # 13.0.5 fixed poll/select on Windows
Expand Down
59 changes: 29 additions & 30 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 8 additions & 3 deletions wahoo_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@
from requests.exceptions import RequestException
from sentry_sdk.integrations.socket import SocketIntegration
from sentry_sdk.integrations.threading import ThreadingIntegration
from watchdog.observers import Observer # type: ignore
from watchdog.observers import Observer

# We can't use Observer in type specifications due to
# https://github.com/gorakhargosh/watchdog/issues/982 but we can use
# BaseObserver as a workaround
from watchdog.observers.api import BaseObserver

import autotest
import imagecast
Expand Down Expand Up @@ -152,7 +157,7 @@ def handle_bg_import() -> None:
model.bg_clear.add(lambda: model.image_bg.set(""))


def setup_scb_watcher(model: Model, observer: Observer) -> None:
def setup_scb_watcher(model: Model, observer: BaseObserver) -> None:
"""Set up file system watcher for startlists"""

def process_startlists() -> None:
Expand Down Expand Up @@ -231,7 +236,7 @@ def load_result(model: Model, filename: str) -> Optional[RaceTimes]:
return racetime


def setup_do4_watcher(model: Model, observer: Observer) -> None:
def setup_do4_watcher(model: Model, observer: BaseObserver) -> None:
"""Set up watches for files/directories and connect to model"""

def process_racedir() -> None:
Expand Down

0 comments on commit 79a7517

Please sign in to comment.