--reload-exclude cannot recursively ignore directories with '**' glob; changes outside --reload-dir trigger reload #2526
Unanswered
AntiSol
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
-
Using uvicorn 0.32.1 (installed via pip) and python 3.9.18, and the attached directory structure (zipfile: uvicorn_test.zip), it seems that uvicorn is:
a) not properly honouring globs including the '**' pattern and
b) not properly honouring --reload-dir
steps to reproduce:
python3 -m venv venv
. venv/bin/activate
pip install -r requirements.txt
uvicorn --host 0.0.0.0 --port 4242 --reload --reload-dir myapp --reload-dir mylib/ --reload-exclude 'infra/**' myapp.api.main:app
echo "changed" >> infra/packages/foo/bar/baz.py
a) --reload-dir specifying only the 2 directories and
b) --reload-exclude specifically excluding subdirectories of infra/ using the '**' glob pattern.
uvicorn --host 0.0.0.0 --port 4242 --reload --reload-exclude 'infra/**' myapp.api.main:app
(removing --reload-dir)Output from uvicorn when I start it and modify the file in infra/packages/:
Another note: providing --reload-dir but not --reload gives the following output:
WARNING: Current configuration will not reload as not all conditions are met, please refer to documentation.
But I can't see anything about this in the documentation. I wouldn't expect to have to pass --reload if I'm passing --reload-dir, doesn't the one imply the other?
Beta Was this translation helpful? Give feedback.
All reactions