debugger.py 360 B

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