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

The plan for watchfiles, née watchgod #102

Closed
samuelcolvin opened this issue Mar 23, 2022 · 5 comments
Closed

The plan for watchfiles, née watchgod #102

samuelcolvin opened this issue Mar 23, 2022 · 5 comments

Comments

@samuelcolvin
Copy link
Owner

samuelcolvin commented Mar 23, 2022

This issue replaces #25 and #96 as my plan has change significantly.

I've wanted to rename watchgod for a while, I've also wanted to migrate from file scanning/polling to a rust based file system notification backend. Instead of doing that as two separate (disruptive) steps, I'm going to do them together.

TL;DR; watchgod is being renamed to watchfiles and rewritten in rust. watchgod will remain available in pypi (with a message about migrating).

  • watchgod will remain unchanged with the file scanning python code
  • watchfiles will use the new rust backend from it's first release

See this thread for a discussion of the arguments, merits & drawbacks of both renaming packages, and the name "watchgod".

I wanted a new name that was fairly close to the current name (still had the "watch" idea) but wasn't as easily confused. I originally thought about "watchman", but there's already a package by that name maintained by facebook. @thornycrackers was kind enough to release the name watchfiles in pypi so I could use it for this package. Big thanks to @thornycrackers for being so responsive and generous. I've uploaded a holding package to secure that name.

The process for switching will be roughly as follows (see the twitter thread above for a discussion of how to go about this):

  1. Rename in the codebase, effectively *.replace('god', 'files'), include a notice in the readme about the "old" name
  2. Rename the github repo
  3. release the new codebase to pypi under the name watchfiles, version will be v0.10 to avoid confusion with watchgod versions
  4. release a version of watchgod with a prominent notice in the readme about the new name and migration, add the Development Status :: 7 - Inactive pypi classifier
  5. Perhaps in future release a final version of watchgod with:
  • deprecation warnings on the main public functions explaining about the renaming
  • if this gets approved before the release, add a pip announcement
@tynandebold
Copy link

tynandebold commented Mar 23, 2022

So are there any breaking changes when moving from watchgod to watchfiles, or is this a rename only?

@samuelcolvin
Copy link
Owner Author

samuelcolvin commented Mar 23, 2022

The basic methods:

  • watch
  • awatch
  • run_process
  • arun_process

All remain, but the arguments have changed.

In particular the way changes are filtered has changed completely.

I'll add a section to the new docs.

@Dreamsorcerer
Copy link
Contributor

How should code be changed in regards to awatch.lock? Specifically, this line in aiohttp-devtools:
https://github.com/aio-libs/aiohttp-devtools/blob/master/aiohttp_devtools/runserver/watch.py#L37

@samuelcolvin
Copy link
Owner Author

I think you can just remove it.

I can't think of any potential race conditions ... Until someone finds one.

@samuelcolvin
Copy link
Owner Author

This is all done, except adding a deprecation warning in watchgod which 1) shouldn't happen for months, 2) is debatable anyway.

@samuelcolvin samuelcolvin unpinned this issue Apr 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants