Skip to content

Commit f729d89

Browse files
committed
reattempt at granian as default
1 parent 3bcf01d commit f729d89

3 files changed

Lines changed: 15 additions & 33 deletions

File tree

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ dependencies = [
2323
"alembic >=1.15.2,<2.0",
2424
"fastapi >=0.115.0",
2525
"granian[reload] >=2.2.5",
26-
"gunicorn >=23.0.0,<24.0.0",
2726
"httpx >=0.28.0,<1.0",
2827
"jinja2 >=3.1.2,<4.0",
2928
"packaging >=24.2,<26",
@@ -38,7 +37,6 @@ dependencies = [
3837
"sqlmodel >=0.0.24,<0.1",
3938
"typer >=0.15.2,<1.0",
4039
"typing_extensions >=4.13.0",
41-
"uvicorn >=0.34.0",
4240
"wrapt >=1.17.0,<2.0",
4341
]
4442
classifiers = [
@@ -166,4 +164,6 @@ dev = [
166164
"ruff >=0.11",
167165
"selenium >=4.31",
168166
"starlette-admin >=0.14",
167+
"uvicorn >=0.34.0",
168+
169169
]

reflex/utils/exec.py

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -189,11 +189,9 @@ def run_frontend_prod(root: Path, port: str, backend_present: bool = True):
189189

190190
@once
191191
def _warn_user_about_uvicorn():
192-
# When we eventually switch to Granian by default, we should enable this warning.
193-
if False:
194-
console.warn(
195-
"Using Uvicorn for backend as it is installed. This behavior will change in 0.8.0 to use Granian by default."
196-
)
192+
console.warn(
193+
"Using Uvicorn for backend as it is installed. This behavior will change in 0.8.0 to use Granian by default."
194+
)
197195

198196

199197
def should_use_granian():
@@ -202,8 +200,8 @@ def should_use_granian():
202200
Returns:
203201
True if Granian should be used.
204202
"""
205-
if environment.REFLEX_USE_GRANIAN.get():
206-
return True
203+
if environment.REFLEX_USE_GRANIAN.is_set():
204+
return environment.REFLEX_USE_GRANIAN.get()
207205
if (
208206
importlib.util.find_spec("uvicorn") is None
209207
or importlib.util.find_spec("gunicorn") is None
@@ -367,14 +365,12 @@ def _deprecate_asgi_config(
367365
config_name: str,
368366
reason: str = "",
369367
):
370-
# When we eventually switch to Granian by default, we should enable this deprecation.
371-
if False:
372-
console.deprecate(
373-
f"config.{config_name}",
374-
reason=reason,
375-
deprecation_version="0.7.5",
376-
removal_version="0.8.0",
377-
)
368+
console.deprecate(
369+
f"config.{config_name}",
370+
reason=reason,
371+
deprecation_version="0.7.9",
372+
removal_version="0.8.0",
373+
)
378374

379375

380376
@once

uv.lock

Lines changed: 2 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)