-
-
Notifications
You must be signed in to change notification settings - Fork 109
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
Add ignore_permission_denied option #224
Add ignore_permission_denied option #224
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #224 +/- ##
=======================================
Coverage 99.50% 99.51%
=======================================
Files 6 6
Lines 403 411 +8
Branches 82 83 +1
=======================================
+ Hits 401 409 +8
Misses 1 1
Partials 1 1
Continue to review full report in Codecov by Sentry.
|
Looks like a great start. The parameter should be called And it should cause only permission denied errors to be ignored. |
3953c73
to
d87625d
Compare
857911d
to
4659abb
Compare
Not sure why, but doing |
I'll review properly soon, but would be good if we respected an env variable so it could be set when using watchfiles with uvicorn etc. - that's much more common than the command line usage. |
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.
and the env var I mentioned.
06930c6
to
2b26204
Compare
Thanks for the review |
thanks so much. |
Hi here, thank you for adding the I just want to flag that I observed strange behaviour with it (Linux). Which might help other people to save some time. It stops watching directories if permission-denied occurs on the first directory in the workdir. Example you have a directory
Directory setup# LC_COLLATE="C.UTF-8"
# directories setup
mkdir tmp && cd tmp
mkdir a b c
touch a/test.txt b/test.txt c/test.txt Example 1 (unexpected behaviour)
Example 2 (expected behaviour)
In uvicorn for example here is recommended to use env var (WATCHFILES_IGNORE_PERMISSION_DENIED) but it does not help because of above.
|
Bump the minimum watchfiles version to ensure that ignore_permission_denied, added in samuelcolvin/watchfiles#224 and released in https://github.com/samuelcolvin/watchfiles/releases/tag/v0.20.0 is present.
Bump the minimum watchfiles version to ensure that ignore_permission_denied, added in samuelcolvin/watchfiles#224 and released in https://github.com/samuelcolvin/watchfiles/releases/tag/v0.20.0 is present.
Continue to watch files are replaced, such as by saving in vi, by watching the parent directory instead. Add a test, that fails under the previous version, for a modification to a file after it is deleted and recreated. Bump the minimum watchfiles version to ensure that ignore_permission_denied, added in samuelcolvin/watchfiles#224 and released in https://github.com/samuelcolvin/watchfiles/releases/tag/v0.20.0 is present. Co-authored-by: Jakob Schnitzer <[email protected]>
Closes #147