From 2f91465106a27c0e2a063781fbdff9e890059512 Mon Sep 17 00:00:00 2001 From: Benedikt Bartscher Date: Thu, 31 Oct 2024 21:13:06 +0100 Subject: [PATCH] readd deleted functions and deprecate them --- reflex/utils/exec.py | 45 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/reflex/utils/exec.py b/reflex/utils/exec.py index fe4aeb741..6792e903e 100644 --- a/reflex/utils/exec.py +++ b/reflex/utils/exec.py @@ -485,6 +485,51 @@ def is_testing_env() -> bool: return constants.PYTEST_CURRENT_TEST in os.environ +def is_frontend_only() -> bool: + """Check if the app is running in frontend-only mode. + + Returns: + True if the app is running in frontend-only mode. + """ + console.deprecate( + "is_frontend_only() is deprecated and will be removed in a future release.", + reason="Use `environment.REFLEX_FRONTEND_ONLY.get()` instead.", + deprecation_version="0.6.5", + removal_version="0.7.0", + ) + return environment.REFLEX_FRONTEND_ONLY.get() + + +def is_backend_only() -> bool: + """Check if the app is running in backend-only mode. + + Returns: + True if the app is running in backend-only mode. + """ + console.deprecate( + "is_backend_only() is deprecated and will be removed in a future release.", + reason="Use `environment.REFLEX_BACKEND_ONLY.get()` instead.", + deprecation_version="0.6.5", + removal_version="0.7.0", + ) + return environment.REFLEX_BACKEND_ONLY.get() + + +def should_skip_compile() -> bool: + """Whether the app should skip compile. + + Returns: + True if the app should skip compile. + """ + console.deprecate( + "should_skip_compile() is deprecated and will be removed in a future release.", + reason="Use `environment.REFLEX_SKIP_COMPILE.get()` instead.", + deprecation_version="0.6.5", + removal_version="0.7.0", + ) + return environment.REFLEX_SKIP_COMPILE.get() + + def is_prod_mode() -> bool: """Check if the app is running in production mode.