Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use watchfiles #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

use watchfiles #1

wants to merge 1 commit into from

Conversation

bollwyvl
Copy link

Elevator Pitch

This strawman PR replaces ipynotify and macfsevents with the more-supported watchfiles, implemented in rust under the hood, which also works on windows.

References

Code Changes

  • depend on watchfiles
  • use watchfiles
  • remove platform-specific handling and test skips
  • simplify event masking, etc
    • some of these could be restored, though the range of events is far smaller (see below)

Breaking Changes

  • the signature of handle_event is entirely different
    • it now receives a set of (change, path) pairs, where change is one of 1 (add), 2 (delete), or 3 (modify)
  • the no-longer-tested loop_callback is removed

Possible Work: on this PR or future

  • more of the previous handle_event(event) signature could be emulated
  • the loop_callback behavior could be restored with yield_on_timeout (it yields an empty set)

Thanks again for doit!

@schettino72
Copy link
Member

Cool. thanks. Have not looked in detail but code looks much cleaner.

Just that my idea was to fork this plugin and create a new one for watchfiles.

And I wondering I if should call it doit-watch instead of auto,
it seems it is a much more common name for such functionality (specially given the underlying lib).

What do you think?

@bollwyvl
Copy link
Author

bollwyvl commented Apr 23, 2022 via email

rix0rrr added a commit to rix0rrr/doit_watch that referenced this pull request Dec 9, 2023
This code is mostly a straight copy of pydoit/doit-auto1#1
and pydoit/doit-auto1#2.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

implement cmd auto on Windows
2 participants