From 3893ccf8dcba700165230db9c09e7721b2d00184 Mon Sep 17 00:00:00 2001 From: Khaleel Al-Adhami Date: Wed, 16 Oct 2024 17:00:02 -0700 Subject: [PATCH] remove cyclical imports --- reflex/constants/installer.py | 8 -------- reflex/utils/path_ops.py | 5 +++-- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/reflex/constants/installer.py b/reflex/constants/installer.py index a6acf277e..a3325f074 100644 --- a/reflex/constants/installer.py +++ b/reflex/constants/installer.py @@ -5,8 +5,6 @@ from __future__ import annotations import platform from types import SimpleNamespace -from reflex.config import environment - from .base import IS_WINDOWS, Reflex @@ -55,9 +53,6 @@ class Bun(SimpleNamespace): # Path of the bunfig file CONFIG_PATH = "bunfig.toml" - # The environment variable to use the system installed bun. - USE_SYSTEM = environment.REFLEX_USE_SYSTEM_BUN - # FNM config. class Fnm(SimpleNamespace): @@ -101,9 +96,6 @@ class Node(SimpleNamespace): # The default path where npm is installed. NPM_PATH = BIN_PATH / "npm" - # The environment variable to use the system installed node. - USE_SYSTEM = environment.REFLEX_USE_SYSTEM_NODE - class PackageJson(SimpleNamespace): """Constants used to build the package.json file.""" diff --git a/reflex/utils/path_ops.py b/reflex/utils/path_ops.py index 902f37c97..ee93b24cf 100644 --- a/reflex/utils/path_ops.py +++ b/reflex/utils/path_ops.py @@ -9,6 +9,7 @@ import shutil from pathlib import Path from reflex import constants +from reflex.config import environment # Shorthand for join. join = os.linesep.join @@ -135,7 +136,7 @@ def use_system_node() -> bool: Returns: Whether the system node should be used. """ - return constants.Node.USE_SYSTEM + return environment.REFLEX_USE_SYSTEM_NODE def use_system_bun() -> bool: @@ -144,7 +145,7 @@ def use_system_bun() -> bool: Returns: Whether the system bun should be used. """ - return constants.Bun.USE_SYSTEM + return environment.REFLEX_USE_SYSTEM_BUN def get_node_bin_path() -> Path | None: