Context
Reflex was intended to default to Granian in 0.9, but the current automatic selection still chooses the Uvicorn/Gunicorn backend when both packages are importable and REFLEX_USE_GRANIAN is unset. This is especially visible in upgraded environments that retain the old backend dependencies.
PR #6758 only updates the resulting warning. The underlying selection behavior should be fixed instead.
Proposed behavior
- Default
REFLEX_USE_GRANIAN to True.
- Use Granian when
REFLEX_USE_GRANIAN is unset or true, regardless of whether Uvicorn/Gunicorn happen to be installed.
- Use the Uvicorn/Gunicorn backend only when
REFLEX_USE_GRANIAN=0 and its required packages are installed.
- Remove the Uvicorn fallback warning because that backend becomes fully opt-in.
Expected selection matrix
REFLEX_USE_GRANIAN |
Result |
| Unset |
Granian |
1 / true |
Granian |
0 / false, Uvicorn/Gunicorn available |
Uvicorn/Gunicorn |
0 / false, required packages missing |
Define and test an actionable failure or fallback behavior |
Acceptance criteria
- Update backend-selection logic and the environment-variable default/documentation.
- Remove the obsolete Uvicorn fallback warning.
- Add unit coverage for every row in the selection matrix.
- Update user-facing documentation and add the appropriate news fragment.
- Confirm whether this ships in the next 0.9.x release or requires 0.10.0 before implementation.
Supersedes #6758.
Context
Reflex was intended to default to Granian in 0.9, but the current automatic selection still chooses the Uvicorn/Gunicorn backend when both packages are importable and
REFLEX_USE_GRANIANis unset. This is especially visible in upgraded environments that retain the old backend dependencies.PR #6758 only updates the resulting warning. The underlying selection behavior should be fixed instead.
Proposed behavior
REFLEX_USE_GRANIANtoTrue.REFLEX_USE_GRANIANis unset or true, regardless of whether Uvicorn/Gunicorn happen to be installed.REFLEX_USE_GRANIAN=0and its required packages are installed.Expected selection matrix
REFLEX_USE_GRANIAN1/ true0/ false, Uvicorn/Gunicorn available0/ false, required packages missingAcceptance criteria
Supersedes #6758.