Переглянути джерело

Show config in system debug (#1626)

Masen Furer 1 рік тому
батько
коміт
e6dfe67594
2 змінених файлів з 10 додано та 2 видалено
  1. 9 0
      reflex/utils/exec.py
  2. 1 2
      reflex/utils/prerequisites.py

+ 9 - 0
reflex/utils/exec.py

@@ -166,7 +166,15 @@ def output_system_info():
     if console.LOG_LEVEL > constants.LogLevel.DEBUG:
     if console.LOG_LEVEL > constants.LogLevel.DEBUG:
         return
         return
 
 
+    config = get_config()
+    try:
+        config_file = sys.modules[config.__module__].__file__
+    except Exception:
+        config_file = None
+
     console.rule(f"System Info")
     console.rule(f"System Info")
+    console.debug(f"Config file: {config_file!r}")
+    console.debug(f"Config: {config}")
 
 
     dependencies = [
     dependencies = [
         f"[Reflex {constants.VERSION} with Python {platform.python_version()} (PATH: {sys.executable})]",
         f"[Reflex {constants.VERSION} with Python {platform.python_version()} (PATH: {sys.executable})]",
@@ -179,6 +187,7 @@ def output_system_info():
         dependencies.extend(
         dependencies.extend(
             [
             [
                 f"[NVM {constants.NVM_VERSION} (Expected: {constants.NVM_VERSION}) (PATH: {constants.NVM_PATH})]",
                 f"[NVM {constants.NVM_VERSION} (Expected: {constants.NVM_VERSION}) (PATH: {constants.NVM_PATH})]",
+                f"[Bun {prerequisites.get_bun_version()} (Expected: {constants.BUN_VERSION}) (PATH: {config.bun_path})]",
             ],
             ],
         )
         )
     else:
     else:

+ 1 - 2
reflex/utils/prerequisites.py

@@ -39,8 +39,7 @@ def check_node_version() -> bool:
             if constants.IS_WINDOWS
             if constants.IS_WINDOWS
             else current_version == version.parse(constants.NODE_VERSION)
             else current_version == version.parse(constants.NODE_VERSION)
         )
         )
-    else:
-        return False
+    return False
 
 
 
 
 def get_node_version() -> Optional[version.Version]:
 def get_node_version() -> Optional[version.Version]: