From 1c8e67077c4611b3927640ddf9714ac8e942d1f1 Mon Sep 17 00:00:00 2001 From: VishnuSanal Date: Mon, 1 Jul 2024 14:30:32 +0530 Subject: [PATCH 01/13] [#62] feat: control dev mode with env var --- robyn/__init__.py | 2 -- robyn/cli.py | 7 +++++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/robyn/__init__.py b/robyn/__init__.py index 656f1a91f..3c587f17b 100644 --- a/robyn/__init__.py +++ b/robyn/__init__.py @@ -11,7 +11,6 @@ from robyn.argument_parser import Config from robyn.authentication import AuthenticationHandler from robyn.dependency_injection import DependencyMap -from robyn.env_populator import load_vars from robyn.events import Events from robyn.jsonify import jsonify from robyn.logger import Colors, logger @@ -48,7 +47,6 @@ def __init__( self.config = config self.dependencies = dependencies - load_vars(project_root=directory_path) logging.basicConfig(level=self.config.log_level) if self.config.log_level.lower() != "warn": diff --git a/robyn/cli.py b/robyn/cli.py index 385348890..fbef9ecce 100644 --- a/robyn/cli.py +++ b/robyn/cli.py @@ -6,6 +6,7 @@ from InquirerPy.base.control import Choice from .argument_parser import Config from .reloader import create_rust_file, setup_reloader +from robyn.env_populator import load_vars from robyn.robyn import get_version from pathlib import Path import shutil @@ -104,6 +105,12 @@ def start_app_normally(config: Config): def run(): config = Config() + + load_vars(project_root=os.path.dirname(os.path.abspath(config.file_path))) + + if not config.dev: + config.dev = bool(os.getenv("ROBYN_DEV_MODE", False)) + if config.create: create_robyn_app() From 6c580bc41fee3b82ba37010abd88265714772b5a Mon Sep 17 00:00:00 2001 From: VishnuSanal Date: Thu, 4 Jul 2024 21:38:04 +0530 Subject: [PATCH 02/13] add `load_vars` back to __init__ --- robyn/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/robyn/__init__.py b/robyn/__init__.py index 3c587f17b..656f1a91f 100644 --- a/robyn/__init__.py +++ b/robyn/__init__.py @@ -11,6 +11,7 @@ from robyn.argument_parser import Config from robyn.authentication import AuthenticationHandler from robyn.dependency_injection import DependencyMap +from robyn.env_populator import load_vars from robyn.events import Events from robyn.jsonify import jsonify from robyn.logger import Colors, logger @@ -47,6 +48,7 @@ def __init__( self.config = config self.dependencies = dependencies + load_vars(project_root=directory_path) logging.basicConfig(level=self.config.log_level) if self.config.log_level.lower() != "warn": From ff5b8dd45bd78f850cbe4168bfacb0b551a8546f Mon Sep 17 00:00:00 2001 From: VishnuSanal Date: Thu, 4 Jul 2024 21:41:31 +0530 Subject: [PATCH 03/13] docs: add docs for `ROBYN_DEV_MODE` --- docs_src/src/pages/documentation/api_reference/robyn_env.mdx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs_src/src/pages/documentation/api_reference/robyn_env.mdx b/docs_src/src/pages/documentation/api_reference/robyn_env.mdx index c0eed44cd..681440330 100644 --- a/docs_src/src/pages/documentation/api_reference/robyn_env.mdx +++ b/docs_src/src/pages/documentation/api_reference/robyn_env.mdx @@ -16,6 +16,9 @@ Batman wanted to configure the server through an environment file. Changing code - `ROBYN_BROWSER_OPEN`: Open the browser on successful start. - Default: `False` - Example: `ROBYN_BROWSER_OPEN=True` + - `ROBYN_DEV_MODE`: Configures the dev mode + - Default: `False` + - Example: `ROBYN_DEV_MODE=True` - `ROBYN_MAX_PAYLOAD_SIZE`: Sets the maximum payload size for requests in bytes. - Default: `1000000` bytes - Example: `ROBYN_MAX_PAYLOAD_SIZE=1000000` @@ -40,6 +43,7 @@ ROBYN_PORT=8080 ROBYN_HOST=127.0.0.1 RANDOM_ENV=123 ROBYN_BROWSER_OPEN=True +ROBYN_DEV_MODE=True ROBYN_MAX_PAYLOAD_SIZE=1000000 ``` From b927f0494bf7e0139450e954701d3b46f9c8baec Mon Sep 17 00:00:00 2001 From: VishnuSanal Date: Fri, 5 Jul 2024 13:04:09 +0530 Subject: [PATCH 04/13] fix: give priority to CLI arg --- robyn/argument_parser.py | 2 +- robyn/cli.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/robyn/argument_parser.py b/robyn/argument_parser.py index a1b532f9a..e27899cbb 100644 --- a/robyn/argument_parser.py +++ b/robyn/argument_parser.py @@ -23,7 +23,7 @@ def __init__(self) -> None: "--dev", dest="dev", action="store_true", - default=False, + default=None, help="Development mode. It restarts the server based on file changes.", ) parser.add_argument( diff --git a/robyn/cli.py b/robyn/cli.py index fbef9ecce..c69849558 100644 --- a/robyn/cli.py +++ b/robyn/cli.py @@ -108,7 +108,7 @@ def run(): load_vars(project_root=os.path.dirname(os.path.abspath(config.file_path))) - if not config.dev: + if config.dev is None: config.dev = bool(os.getenv("ROBYN_DEV_MODE", False)) if config.create: From 033a3763821b8aee11821445d0189bc1d69a124e Mon Sep 17 00:00:00 2001 From: VishnuSanal Date: Sat, 6 Jul 2024 21:06:16 +0530 Subject: [PATCH 05/13] fix: path when running as a module --- robyn/argument_parser.py | 1 + robyn/cli.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/robyn/argument_parser.py b/robyn/argument_parser.py index e27899cbb..23b4ac92b 100644 --- a/robyn/argument_parser.py +++ b/robyn/argument_parser.py @@ -81,6 +81,7 @@ def __init__(self) -> None: self.version = args.version self.compile_rust_path = args.compile_rust_path self.create_rust_file = args.create_rust_file + self.file_path = None # find something that ends with .py in unknown_args for arg in unknown_args: diff --git a/robyn/cli.py b/robyn/cli.py index c69849558..8b48c6088 100644 --- a/robyn/cli.py +++ b/robyn/cli.py @@ -106,6 +106,9 @@ def start_app_normally(config: Config): def run(): config = Config() + if not config.file_path: + config.file_path = f"{os.getcwd()}/{__name__}" + load_vars(project_root=os.path.dirname(os.path.abspath(config.file_path))) if config.dev is None: From ca7c3619d30c47e67f55e7526e964f9d177f78aa Mon Sep 17 00:00:00 2001 From: VishnuSanal Date: Sat, 6 Jul 2024 21:32:10 +0530 Subject: [PATCH 06/13] give heads up when running as a module + fix bool issue ;__; --- robyn/__init__.py | 6 ++++++ robyn/cli.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/robyn/__init__.py b/robyn/__init__.py index 656f1a91f..ca7fa1ab1 100644 --- a/robyn/__init__.py +++ b/robyn/__init__.py @@ -48,6 +48,8 @@ def __init__( self.config = config self.dependencies = dependencies + dev_mode_env_var = os.getenv("ROBYN_DEV_MODE", False) == "True" + load_vars(project_root=directory_path) logging.basicConfig(level=self.config.log_level) @@ -59,6 +61,10 @@ def __init__( if self.config.dev: exit("Dev mode is not supported in the python wrapper. Please use the CLI. e.g. python3 -m robyn app.py --dev ") + if not dev_mode_env_var and os.getenv("ROBYN_DEV_MODE", False) == "True": + logger.error("Ignoring ROBYN_DEV_MODE environment variable. Dev mode is not supported in the python wrapper.") + logger.warn("Starting app normally...") + self.router = Router() self.middleware_router = MiddlewareRouter() self.web_socket_router = WebSocketRouter() diff --git a/robyn/cli.py b/robyn/cli.py index 8b48c6088..ef9a9b23d 100644 --- a/robyn/cli.py +++ b/robyn/cli.py @@ -112,7 +112,7 @@ def run(): load_vars(project_root=os.path.dirname(os.path.abspath(config.file_path))) if config.dev is None: - config.dev = bool(os.getenv("ROBYN_DEV_MODE", False)) + config.dev = os.getenv("ROBYN_DEV_MODE", False) == "True" if config.create: create_robyn_app() From 394024f5d96fe9cca059349c9115b6d36446f7e5 Mon Sep 17 00:00:00 2001 From: Sanskar Jethi Date: Tue, 9 Jul 2024 16:02:08 +0100 Subject: [PATCH 07/13] update code --- robyn/__init__.py | 21 ++++++++++++++------- robyn/reloader.py | 6 ++++++ 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/robyn/__init__.py b/robyn/__init__.py index ca7fa1ab1..1be7082d7 100644 --- a/robyn/__init__.py +++ b/robyn/__init__.py @@ -48,7 +48,7 @@ def __init__( self.config = config self.dependencies = dependencies - dev_mode_env_var = os.getenv("ROBYN_DEV_MODE", False) == "True" + self._handle_dev_mode() load_vars(project_root=directory_path) logging.basicConfig(level=self.config.log_level) @@ -58,12 +58,6 @@ def __init__( "SERVER IS RUNNING IN VERBOSE/DEBUG MODE. Set --log-level to WARN to run in production mode.", color=Colors.BLUE, ) - if self.config.dev: - exit("Dev mode is not supported in the python wrapper. Please use the CLI. e.g. python3 -m robyn app.py --dev ") - - if not dev_mode_env_var and os.getenv("ROBYN_DEV_MODE", False) == "True": - logger.error("Ignoring ROBYN_DEV_MODE environment variable. Dev mode is not supported in the python wrapper.") - logger.warn("Starting app normally...") self.router = Router() self.middleware_router = MiddlewareRouter() @@ -75,6 +69,19 @@ def __init__( self.exception_handler: Optional[Callable] = None self.authentication_handler: Optional[AuthenticationHandler] = None + def _handle_dev_mode(self): + cli_dev_mode = self.config.dev + env_dev_mode = os.getenv("ROBYN_DEV_MODE", "False").lower() == "true" + # if we have reached here and we have ROBYN_DEV_MODE set to True + # we understand that we are operating in CLI mode and not through the ROBYN MODULE + + if cli_dev_mode: + raise SystemExit("Dev mode is not supported in the python wrapper. Please use the CLI. e.g. python3 -m robyn app.py --dev") + + if env_dev_mode: + logger.error("Ignoring ROBYN_DEV_MODE environment variable. Dev mode is not supported in the python wrapper.") + logger.warn("Starting app normally...") + def add_route( self, route_type: Union[HttpMethod, str], diff --git a/robyn/reloader.py b/robyn/reloader.py index 9a93df40f..cce1349fc 100644 --- a/robyn/reloader.py +++ b/robyn/reloader.py @@ -109,6 +109,12 @@ def reload(self): new_env = os.environ.copy() new_env["IS_RELOADER_RUNNING"] = "True" # This is used to check if a reloader is already running + # IS_RELOADER_RUNNING is specifically used for IPC between the reloader and the server + + if "ROBYN_DEV_MODE" in new_env: + # we are deleting the ROBYN_DEV_MODE environment variable as the + # child processes should not be in dev mode, i.e. can be killed by the reloader + del new_env["ROBYN_DEV_MODE"] print(f"Reloading {self.file_path}...") arguments = [arg for arg in sys.argv[1:] if not arg.startswith("--dev")] From f6b088c877debe38b1000888326a3b102f2abae3 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 9 Jul 2024 15:06:28 +0000 Subject: [PATCH 08/13] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- robyn/reloader.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/robyn/reloader.py b/robyn/reloader.py index cce1349fc..0a3e2e7c9 100644 --- a/robyn/reloader.py +++ b/robyn/reloader.py @@ -110,10 +110,10 @@ def reload(self): new_env = os.environ.copy() new_env["IS_RELOADER_RUNNING"] = "True" # This is used to check if a reloader is already running # IS_RELOADER_RUNNING is specifically used for IPC between the reloader and the server - + if "ROBYN_DEV_MODE" in new_env: - # we are deleting the ROBYN_DEV_MODE environment variable as the - # child processes should not be in dev mode, i.e. can be killed by the reloader + # we are deleting the ROBYN_DEV_MODE environment variable as the + # child processes should not be in dev mode, i.e. can be killed by the reloader del new_env["ROBYN_DEV_MODE"] print(f"Reloading {self.file_path}...") From 606588a216d225f68ff1851b036c3877b2d82d9f Mon Sep 17 00:00:00 2001 From: Sanskar Jethi Date: Mon, 15 Jul 2024 15:39:02 +0100 Subject: [PATCH 09/13] update --- integration_tests/base_routes.py | 1 + robyn/__init__.py | 18 +++++++++++------- robyn/reloader.py | 4 +++- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/integration_tests/base_routes.py b/integration_tests/base_routes.py index 7ebb87b64..cae198507 100644 --- a/integration_tests/base_routes.py +++ b/integration_tests/base_routes.py @@ -1,6 +1,7 @@ import os import pathlib + from collections import defaultdict from typing import Optional diff --git a/robyn/__init__.py b/robyn/__init__.py index 1be7082d7..dafd6382f 100644 --- a/robyn/__init__.py +++ b/robyn/__init__.py @@ -2,6 +2,7 @@ import logging import os import socket +import sys from typing import Callable, List, Optional, Tuple, Union import multiprocess as mp @@ -18,8 +19,10 @@ from robyn.processpool import run_processes from robyn.reloader import compile_rust_files from robyn.responses import html, serve_file, serve_html -from robyn.robyn import FunctionInfo, Headers, HttpMethod, Request, Response, WebSocketConnector, get_version -from robyn.router import MiddlewareRouter, MiddlewareType, Router, WebSocketRouter +from robyn.robyn import (FunctionInfo, Headers, HttpMethod, Request, Response, + WebSocketConnector, get_version) +from robyn.router import (MiddlewareRouter, MiddlewareType, Router, + WebSocketRouter) from robyn.types import Directory from robyn.ws import WebSocket @@ -48,9 +51,10 @@ def __init__( self.config = config self.dependencies = dependencies - self._handle_dev_mode() + if 'robyn' in os.path.basename(sys.argv[0]).lower(): + # the env variables are already set when are running through the cli + load_vars(project_root=directory_path) - load_vars(project_root=directory_path) logging.basicConfig(level=self.config.log_level) if self.config.log_level.lower() != "warn": @@ -74,13 +78,13 @@ def _handle_dev_mode(self): env_dev_mode = os.getenv("ROBYN_DEV_MODE", "False").lower() == "true" # if we have reached here and we have ROBYN_DEV_MODE set to True # we understand that we are operating in CLI mode and not through the ROBYN MODULE - if cli_dev_mode: - raise SystemExit("Dev mode is not supported in the python wrapper. Please use the CLI. e.g. python3 -m robyn app.py --dev") + raise SystemExit("Dev mode is not supported in the python wrapper. Please use the Robyn CLI. e.g. python3 -m robyn app.py --dev") if env_dev_mode: + logger.info(f"{cli_dev_mode=}") logger.error("Ignoring ROBYN_DEV_MODE environment variable. Dev mode is not supported in the python wrapper.") - logger.warn("Starting app normally...") + raise SystemExit("Dev mode is not supported in the python wrapper. Please use the Robyn CLI. e.g. python3 -m robyn app.py --dev") def add_route( self, diff --git a/robyn/reloader.py b/robyn/reloader.py index cce1349fc..bf121f44b 100644 --- a/robyn/reloader.py +++ b/robyn/reloader.py @@ -106,6 +106,7 @@ def stop_server(self): def reload(self): self.stop_server() + print("Reloading the server") new_env = os.environ.copy() new_env["IS_RELOADER_RUNNING"] = "True" # This is used to check if a reloader is already running @@ -116,8 +117,9 @@ def reload(self): # child processes should not be in dev mode, i.e. can be killed by the reloader del new_env["ROBYN_DEV_MODE"] - print(f"Reloading {self.file_path}...") + # print(f"Reloading {self.file_path}...", new_env["ROBYN_DEV_MODE"]) arguments = [arg for arg in sys.argv[1:] if not arg.startswith("--dev")] + print("argumens") clean_rust_binaries(self.built_rust_binaries) self.built_rust_binaries = compile_rust_files(self.directory_path) From 47da13ff106f759e52d2b7d503cf878ed2cf44bb Mon Sep 17 00:00:00 2001 From: Sanskar Jethi Date: Mon, 15 Jul 2024 16:02:45 +0100 Subject: [PATCH 10/13] update --- robyn/__init__.py | 20 +++++++++++--------- robyn/cli.py | 1 + robyn/reloader.py | 5 ----- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/robyn/__init__.py b/robyn/__init__.py index dafd6382f..61676b320 100644 --- a/robyn/__init__.py +++ b/robyn/__init__.py @@ -51,10 +51,13 @@ def __init__( self.config = config self.dependencies = dependencies - if 'robyn' in os.path.basename(sys.argv[0]).lower(): + + if bool(os.environ.get("ROBYN_CLI", False)) == False: # the env variables are already set when are running through the cli load_vars(project_root=directory_path) + self._handle_dev_mode() + logging.basicConfig(level=self.config.log_level) if self.config.log_level.lower() != "warn": @@ -74,17 +77,16 @@ def __init__( self.authentication_handler: Optional[AuthenticationHandler] = None def _handle_dev_mode(self): - cli_dev_mode = self.config.dev - env_dev_mode = os.getenv("ROBYN_DEV_MODE", "False").lower() == "true" - # if we have reached here and we have ROBYN_DEV_MODE set to True - # we understand that we are operating in CLI mode and not through the ROBYN MODULE - if cli_dev_mode: + cli_dev_mode = self.config.dev # --dev + env_dev_mode = os.getenv("ROBYN_DEV_MODE", "False").lower() == "true" # ROBYN_DEV_MODE=True + is_robyn = os.getenv("ROBYN_CLI", False) + + if cli_dev_mode and not is_robyn: raise SystemExit("Dev mode is not supported in the python wrapper. Please use the Robyn CLI. e.g. python3 -m robyn app.py --dev") - if env_dev_mode: - logger.info(f"{cli_dev_mode=}") + if env_dev_mode and not is_robyn: logger.error("Ignoring ROBYN_DEV_MODE environment variable. Dev mode is not supported in the python wrapper.") - raise SystemExit("Dev mode is not supported in the python wrapper. Please use the Robyn CLI. e.g. python3 -m robyn app.py --dev") + raise SystemExit("Dev mode is not supported in the python wrapper. Please use the Robyn CLI. e.g. python3 -m robyn app.py") def add_route( self, diff --git a/robyn/cli.py b/robyn/cli.py index ef9a9b23d..86f925d18 100644 --- a/robyn/cli.py +++ b/robyn/cli.py @@ -110,6 +110,7 @@ def run(): config.file_path = f"{os.getcwd()}/{__name__}" load_vars(project_root=os.path.dirname(os.path.abspath(config.file_path))) + os.environ["ROBYN_CLI"] = "True" if config.dev is None: config.dev = os.getenv("ROBYN_DEV_MODE", False) == "True" diff --git a/robyn/reloader.py b/robyn/reloader.py index bf121f44b..4e51312fc 100644 --- a/robyn/reloader.py +++ b/robyn/reloader.py @@ -112,11 +112,6 @@ def reload(self): new_env["IS_RELOADER_RUNNING"] = "True" # This is used to check if a reloader is already running # IS_RELOADER_RUNNING is specifically used for IPC between the reloader and the server - if "ROBYN_DEV_MODE" in new_env: - # we are deleting the ROBYN_DEV_MODE environment variable as the - # child processes should not be in dev mode, i.e. can be killed by the reloader - del new_env["ROBYN_DEV_MODE"] - # print(f"Reloading {self.file_path}...", new_env["ROBYN_DEV_MODE"]) arguments = [arg for arg in sys.argv[1:] if not arg.startswith("--dev")] print("argumens") From 58338de2997ba02c337a945089dfb78ec46be6a1 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 15 Jul 2024 15:04:02 +0000 Subject: [PATCH 11/13] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- robyn/__init__.py | 11 ++++------- robyn/reloader.py | 2 +- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/robyn/__init__.py b/robyn/__init__.py index 61676b320..ffb641179 100644 --- a/robyn/__init__.py +++ b/robyn/__init__.py @@ -19,10 +19,8 @@ from robyn.processpool import run_processes from robyn.reloader import compile_rust_files from robyn.responses import html, serve_file, serve_html -from robyn.robyn import (FunctionInfo, Headers, HttpMethod, Request, Response, - WebSocketConnector, get_version) -from robyn.router import (MiddlewareRouter, MiddlewareType, Router, - WebSocketRouter) +from robyn.robyn import FunctionInfo, Headers, HttpMethod, Request, Response, WebSocketConnector, get_version +from robyn.router import MiddlewareRouter, MiddlewareType, Router, WebSocketRouter from robyn.types import Directory from robyn.ws import WebSocket @@ -51,7 +49,6 @@ def __init__( self.config = config self.dependencies = dependencies - if bool(os.environ.get("ROBYN_CLI", False)) == False: # the env variables are already set when are running through the cli load_vars(project_root=directory_path) @@ -77,8 +74,8 @@ def __init__( self.authentication_handler: Optional[AuthenticationHandler] = None def _handle_dev_mode(self): - cli_dev_mode = self.config.dev # --dev - env_dev_mode = os.getenv("ROBYN_DEV_MODE", "False").lower() == "true" # ROBYN_DEV_MODE=True + cli_dev_mode = self.config.dev # --dev + env_dev_mode = os.getenv("ROBYN_DEV_MODE", "False").lower() == "true" # ROBYN_DEV_MODE=True is_robyn = os.getenv("ROBYN_CLI", False) if cli_dev_mode and not is_robyn: diff --git a/robyn/reloader.py b/robyn/reloader.py index 4e51312fc..b69ae6dea 100644 --- a/robyn/reloader.py +++ b/robyn/reloader.py @@ -111,7 +111,7 @@ def reload(self): new_env = os.environ.copy() new_env["IS_RELOADER_RUNNING"] = "True" # This is used to check if a reloader is already running # IS_RELOADER_RUNNING is specifically used for IPC between the reloader and the server - + # print(f"Reloading {self.file_path}...", new_env["ROBYN_DEV_MODE"]) arguments = [arg for arg in sys.argv[1:] if not arg.startswith("--dev")] print("argumens") From 0d2556d810a7626c7b003bb1141360ac20dfed3e Mon Sep 17 00:00:00 2001 From: VishnuSanal Date: Wed, 17 Jul 2024 16:27:23 +0530 Subject: [PATCH 12/13] chore: cleanup --- integration_tests/base_routes.py | 1 - robyn/reloader.py | 2 -- 2 files changed, 3 deletions(-) diff --git a/integration_tests/base_routes.py b/integration_tests/base_routes.py index cae198507..7ebb87b64 100644 --- a/integration_tests/base_routes.py +++ b/integration_tests/base_routes.py @@ -1,7 +1,6 @@ import os import pathlib - from collections import defaultdict from typing import Optional diff --git a/robyn/reloader.py b/robyn/reloader.py index b69ae6dea..82deeea16 100644 --- a/robyn/reloader.py +++ b/robyn/reloader.py @@ -112,9 +112,7 @@ def reload(self): new_env["IS_RELOADER_RUNNING"] = "True" # This is used to check if a reloader is already running # IS_RELOADER_RUNNING is specifically used for IPC between the reloader and the server - # print(f"Reloading {self.file_path}...", new_env["ROBYN_DEV_MODE"]) arguments = [arg for arg in sys.argv[1:] if not arg.startswith("--dev")] - print("argumens") clean_rust_binaries(self.built_rust_binaries) self.built_rust_binaries = compile_rust_files(self.directory_path) From 8f3c44235d0c6d8e96829f7b171f5195ee311872 Mon Sep 17 00:00:00 2001 From: VishnuSanal Date: Fri, 19 Jul 2024 14:52:03 +0530 Subject: [PATCH 13/13] chore: fix ci --- robyn/__init__.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/robyn/__init__.py b/robyn/__init__.py index ffb641179..e051e2116 100644 --- a/robyn/__init__.py +++ b/robyn/__init__.py @@ -2,7 +2,6 @@ import logging import os import socket -import sys from typing import Callable, List, Optional, Tuple, Union import multiprocess as mp @@ -49,7 +48,7 @@ def __init__( self.config = config self.dependencies = dependencies - if bool(os.environ.get("ROBYN_CLI", False)) == False: + if not bool(os.environ.get("ROBYN_CLI", False)): # the env variables are already set when are running through the cli load_vars(project_root=directory_path)