boa icon indicating copy to clipboard operation
boa copied to clipboard

Use watchfiles instead of watchgod

Open davidbrochart opened this issue 2 years ago • 2 comments

We use watchgod here. It has been rewritten in watchfiles. I think we should update with this new dependency.

davidbrochart avatar Mar 24 '22 09:03 davidbrochart

image

  • https://watchfiles.helpmanual.io/migrating/

dhirschfeld avatar Jun 18 '23 04:06 dhirschfeld

New api:

awatch(
    *paths: Union[Path, str],
    watch_filter: Optional[
        Callable[[Change, str], bool]
    ] = DefaultFilter(),
    debounce: int = 1600,
    step: int = 50,
    stop_event: Optional[AnyEvent] = None,
    rust_timeout: Optional[int] = None,
    yield_on_timeout: bool = False,
    debug: bool = False,
    raise_interrupt: Optional[bool] = None,
    force_polling: Optional[bool] = None,
    poll_delay_ms: int = 300,
    recursive: bool = True
) -> AsyncGenerator[Set[FileChange], None]

https://watchfiles.helpmanual.io/api/watch/#watchfiles.awatch

Seems to be only 1 usage: https://github.com/mamba-org/boa/blob/54468bdd0f117cd09293791c0bda6e4457052ace/boa/tui/tui.py#L255-L262

dhirschfeld avatar Jun 18 '23 04:06 dhirschfeld