debugger.py 358 B

12345678910111213
  1. import os
  2. import debugpy
  3. __all__ = ["setup_debugger"]
  4. def setup_debugger(*, host: str = "0.0.0.0", port: int = 5678):
  5. """Configure debugging via debugpy."""
  6. debugpy.listen((host, port))
  7. if os.environ.get("DEBUG_WAIT_FOR_CLIENT"):
  8. print("🔌 debugpy waiting for a client to attach 🔌", flush=True)
  9. debugpy.wait_for_client()