Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/6720.bugfix.md
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 1 addition & 1 deletion reflex/utils/exec.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."
)


Expand Down
15 changes: 15 additions & 0 deletions tests/units/utils/test_exec.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Tests for development backend launchers in ``reflex.utils.exec``."""

import inspect
import os
from pathlib import Path

Expand Down Expand Up @@ -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
Loading