diff --git a/news/6720.bugfix.md b/news/6720.bugfix.md new file mode 100644 index 00000000000..a5532f7bbe2 --- /dev/null +++ b/news/6720.bugfix.md @@ -0,0 +1 @@ +Corrected the Uvicorn backend warning that claimed the switch to Granian as the default would happen in `0.8.0`, a version that has already shipped; it now describes the change as coming in a future release and points to `REFLEX_USE_GRANIAN=1` to opt in early. diff --git a/reflex/utils/exec.py b/reflex/utils/exec.py index 6e0543d93db..9d43dd2fa05 100644 --- a/reflex/utils/exec.py +++ b/reflex/utils/exec.py @@ -377,7 +377,7 @@ def run_frontend_prod(host: str, port: int): @once def _warn_user_about_uvicorn(): console.warn( - "Using Uvicorn for backend as it is installed. This behavior will change in 0.8.0 to use Granian by default." + "Using Uvicorn for backend as it is installed. Reflex will switch to Granian by default in a future release; set REFLEX_USE_GRANIAN=1 to opt in now." ) diff --git a/tests/units/utils/test_exec.py b/tests/units/utils/test_exec.py index 3b752fa9b0f..220e1ee867c 100644 --- a/tests/units/utils/test_exec.py +++ b/tests/units/utils/test_exec.py @@ -1,5 +1,6 @@ """Tests for development backend launchers in ``reflex.utils.exec``.""" +import inspect import os from pathlib import Path @@ -78,3 +79,17 @@ def serve(self): ) assert seen["value"] == "True" + + +def test_warn_user_about_uvicorn_does_not_reference_past_version( + mocker: MockerFixture, +): + """The Uvicorn/Granian warning must not cite a version that has already shipped.""" + warn = mocker.patch.object(exec_utils.console, "warn") + + inspect.unwrap(exec_utils._warn_user_about_uvicorn)() + + warn.assert_called_once() + message = warn.call_args.args[0] + assert "0.8.0" not in message + assert "Granian" in message