Browse Source

Dont use env vars in setup_debugger

Casper van der Wel 1 year ago
parent
commit
c758428f65
2 changed files with 5 additions and 5 deletions
  1. 1 1
      CHANGES.md
  2. 4 4
      clean_python/testing/debugger.py

+ 1 - 1
CHANGES.md

@@ -4,7 +4,7 @@
 ## 0.3.5 (unreleased)
 ## 0.3.5 (unreleased)
 ---------------------
 ---------------------
 
 
-- Nothing changed yet.
+- Don't use environment variables in setup_debugger.
 
 
 
 
 ## 0.3.4 (2023-08-28)
 ## 0.3.4 (2023-08-28)

+ 4 - 4
clean_python/testing/debugger.py

@@ -1,13 +1,13 @@
-import os
-
 import debugpy
 import debugpy
 
 
 __all__ = ["setup_debugger"]
 __all__ = ["setup_debugger"]
 
 
 
 
-def setup_debugger(*, host: str = "0.0.0.0", port: int = 5678):
+def setup_debugger(
+    *, host: str = "0.0.0.0", port: int = 5678, wait_for_client: bool = False
+):
     """Configure debugging via debugpy."""
     """Configure debugging via debugpy."""
     debugpy.listen((host, port))
     debugpy.listen((host, port))
-    if os.environ.get("DEBUG_WAIT_FOR_CLIENT"):
+    if wait_for_client:
         print("🔌 debugpy waiting for a client to attach 🔌", flush=True)
         print("🔌 debugpy waiting for a client to attach 🔌", flush=True)
         debugpy.wait_for_client()
         debugpy.wait_for_client()