Issue in the documentation for --reload-include behavior and glob patterns
#2698
Unanswered
arsalanshaikh13
asked this question in
Potential Issue
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
❗️Problem
The current Uvicorn documentation for
--reload-includeand--reload-excludeis minimal and lacks critical details about:--reload-include "*"doesn't behave as expected.🧪 Reproduction Steps
Given the following command:
uvicorn main:app --host 0.0.0.0 --port 8080 --reload --reload-include "*"Expected behavior: All file changes should trigger reload, including
.py,.json,.env, etc.Actual behavior:
✅ What Works Instead
This pattern works consistently across platforms:
This works fine in shell and docker compose as well
This behavior can be confirmed by reading the source code:
https://github.com/encode/uvicorn/blob/master/uvicorn/supervisors/watchfilesreload.py
Notably:
["*.py"][".*", ".py[cod]", ".sw.*", "~*"]--reload-includeis additive, not overriding.🔍 What’s Missing in the Docs
The Uvicorn documentation for reload options currently says:
But does not:
"*"does not include dotfiles.✅ Suggested Improvements
Add a full explanation of:
.py,.json,.env,.html, etc."*"is not sufficient for all file watching.🙏 Thank You
Thanks for maintaining Uvicorn — it's a fantastic tool. A little more clarity here would go a long way for developers trying to use hot reloading with frontend templates, environment files, or config files.
Beta Was this translation helpful? Give feedback.
All reactions