Skip to content

Commit bb8c75d

Browse files
committed
better run func warning
1 parent cc9518d commit bb8c75d

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/idom/backend/utils.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,7 @@ def run(
3535
implementation: BackendImplementation[Any] | None = None,
3636
) -> None:
3737
"""Run a component with a development server"""
38-
logger.warning(
39-
"You are running a development server. "
40-
"Change this before deploying in production!"
41-
)
38+
logger.warning(_DEVELOPMENT_RUN_FUNC_WARNING)
4239

4340
implementation = implementation or import_module("idom.backend.default")
4441

@@ -127,3 +124,11 @@ def all_implementations() -> Iterator[BackendImplementation[Any]]:
127124
)
128125

129126
yield module
127+
128+
129+
_DEVELOPMENT_RUN_FUNC_WARNING = f"""\
130+
The `run()` function is only intended for testing during development! To run in \
131+
production, consider selecting a supported backend and importing its associated \
132+
`configure()` function from `idom.backend.<package>` where `<package>` is one of \
133+
{list(SUPPORTED_PACKAGES)}. For details refer to the docs on how to run each package.\
134+
"""

0 commit comments

Comments
 (0)