Skip to content

Commit 0d4def4

Browse files
authored
better run func warning (#842)
1 parent 8f3785b commit 0d4def4

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/idom/backend/utils.py

+9-4
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,7 @@ def run(
3030
implementation: BackendImplementation[Any] | None = None,
3131
) -> None:
3232
"""Run a component with a development server"""
33-
logger.warning(
34-
"You are running a development server. "
35-
"Change this before deploying in production!"
36-
)
33+
logger.warning(_DEVELOPMENT_RUN_FUNC_WARNING)
3734

3835
implementation = implementation or import_module("idom.backend.default")
3936

@@ -94,3 +91,11 @@ def all_implementations() -> Iterator[BackendImplementation[Any]]:
9491
)
9592

9693
yield module
94+
95+
96+
_DEVELOPMENT_RUN_FUNC_WARNING = f"""\
97+
The `run()` function is only intended for testing during development! To run in \
98+
production, consider selecting a supported backend and importing its associated \
99+
`configure()` function from `idom.backend.<package>` where `<package>` is one of \
100+
{list(SUPPORTED_PACKAGES)}. For details refer to the docs on how to run each package.\
101+
"""

0 commit comments

Comments
 (0)