Skip to content

Commit

Permalink
better run func warning
Browse files Browse the repository at this point in the history
  • Loading branch information
rmorshea committed Nov 29, 2022
1 parent cc9518d commit bb8c75d
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/idom/backend/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,7 @@ def run(
implementation: BackendImplementation[Any] | None = None,
) -> None:
"""Run a component with a development server"""
logger.warning(
"You are running a development server. "
"Change this before deploying in production!"
)
logger.warning(_DEVELOPMENT_RUN_FUNC_WARNING)

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

Expand Down Expand Up @@ -127,3 +124,11 @@ def all_implementations() -> Iterator[BackendImplementation[Any]]:
)

yield module


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

0 comments on commit bb8c75d

Please sign in to comment.