Skip to content
Open
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
6 changes: 5 additions & 1 deletion sphinx_autobuild/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import watchfiles
from starlette.websockets import WebSocket
from watchfiles import Change

if TYPE_CHECKING:
import os
Expand Down Expand Up @@ -51,7 +52,10 @@ async def main(self) -> None:
async def watch(self) -> None:
async for changes in watchfiles.awatch(
*self.paths,
watch_filter=lambda _, path: not self.ignore(path),
watch_filter=lambda change, path: (
(change != Change.modified or Path(path).is_file())
and not self.ignore(path)
),
):
changed_paths = [Path(path).resolve() for (_, path) in changes]
with ProcessPoolExecutor() as pool:
Expand Down
Loading