-
Notifications
You must be signed in to change notification settings - Fork 113
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
Replace watchgod
library with watchfiles
#2134
Conversation
Signed-off-by: Jitendra Gundaniya <[email protected]>
Signed-off-by: Jitendra Gundaniya <[email protected]>
Signed-off-by: Jitendra Gundaniya <[email protected]>
Signed-off-by: Jitendra Gundaniya <[email protected]>
Signed-off-by: Jitendra Gundaniya <[email protected]>
Signed-off-by: Jitendra Gundaniya <[email protected]>
Signed-off-by: Jitendra Gundaniya <[email protected]>
Signed-off-by: Jitendra Gundaniya <[email protected]>
Signed-off-by: Jitendra Gundaniya <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. thanks :)
Hi @jitu5 , This may not be related to watchgod -> watchfiles migration. But I am seeing more error logs when I edit files i.e.,
If possible, create a new ticket to have debounce for watching files and rebuilding the app or handle these errors someway for a cleaner watch experience. Since these errors have become frequent now, I would suggest we think of a solution before releasing this migration. Thank you Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Users/Ravi_Kumar_Pilla/opt/anaconda3/envs/kedro-viz-py39/lib/python3.9/multiprocessing/__init__.py", line 16, in <module>
from . import context
File "/Users/Ravi_Kumar_Pilla/opt/anaconda3/envs/kedro-viz-py39/lib/python3.9/multiprocessing/context.py", line 6, in <module>
from . import reduction
File "/Users/Ravi_Kumar_Pilla/opt/anaconda3/envs/kedro-viz-py39/lib/python3.9/multiprocessing/reduction.py", line 15, in <module>
import pickle
File "/Users/Ravi_Kumar_Pilla/opt/anaconda3/envs/kedro-viz-py39/lib/python3.9/pickle.py", line 43, in <module>
from _pickle import PickleBuffer
KeyboardInterrupt |
@ravi-kumar-pilla |
Signed-off-by: Jitendra Gundaniya <[email protected]>
Signed-off-by: Jitendra Gundaniya <[email protected]>
Signed-off-by: Jitendra Gundaniya <[email protected]>
Signed-off-by: Jitendra Gundaniya <[email protected]>
Signed-off-by: Jitendra Gundaniya <[email protected]>
Signed-off-by: Jitendra Gundaniya <[email protected]>
Signed-off-by: Jitendra Gundaniya <[email protected]>
Signed-off-by: Jitendra Gundaniya <[email protected]>
Signed-off-by: Jitendra Gundaniya <[email protected]>
Signed-off-by: Jitendra Gundaniya <[email protected]>
Hey @jitu5 after testing your PR, i got a similar error as @ravi-kumar-pilla has too |
@Huongg |
Signed-off-by: Jitendra Gundaniya <[email protected]>
hey @jitu5 I tried a different environment and the error is clear now, it could have the previous environment. But I know have a different error but i might not be related to your changes |
Signed-off-by: Jitendra Gundaniya <[email protected]>
not sure maybe you do |
Signed-off-by: Jitendra Gundaniya <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing! thanks @jitu5 !!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested it again and its working fine for me, thanks @jitu5
Hi @jitu5 , The filter looks good but I see there are many reload requests. I saw we had this even before but is there a way to debounce these calls in watchfiles or a better way to handle file watching ? I tested adding a |
Signed-off-by: Jitendra Gundaniya <[email protected]>
@ravi-kumar-pilla
Because of the second line with except condition, |
# Conflicts: # package/kedro_viz/server.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work !! Thank you @jitu5
Description
Resolves #1589 and #2135
This pull request includes
Replacing the
watchgod
library withwatchfiles
.watchfiles
library updates its API with main methodrun_process
and some other changes as well:watcher_cls
is removed and replaced by watch_filter which should be a simple callable, see filter docsrun_process
method allow multiple paths to be watched, as result, the target argument to run_process & arun_process is now keyword-onlyPlease refer migration guild for more details.
Custom File Filter:
package/kedro_viz/autoreload_file_filter.py
: IntroducedAutoreloadFileFilter
class to filter files based on allowed extensions and.gitignore
patterns.package/tests/test_autoreload_file_filter.py
: Added tests for the newAutoreloadFileFilter
class.Development notes
Library Replacement and File Watching Mechanism Updates:
Replaced
watchgod
withwatchfiles
across various files (package/kedro_viz/launchers/cli/run.py
,package/kedro_viz/launchers/jupyter.py
,package/kedro_viz/server.py
,package/tests/test_launchers/test_cli/test_run.py
,package/tests/test_launchers/test_jupyter.py
)Add
autoreload_file_filter.py
class watch file filterpackage/tests/test_autoreload_file_filter.py
Dependency Updates:
watchgod
withwatchfiles
(package/features/steps/lower_requirements.txt
,package/requirements.txt
)Checklist
RELEASE.md
file