Coverage for src/ramses_cli/debug.py: 42%

12 statements  

« prev     ^ index     » next       coverage.py v7.11.3, created at 2026-01-05 21:44 +0100

1#!/usr/bin/env python3 

2"""A CLI for the ramses_rf library.""" 

3 

4from __future__ import annotations 

5 

6SZ_DBG_MODE = "debug_mode" 

7DEBUG_ADDR = "0.0.0.0" 

8DEBUG_PORT = 5678 

9 

10 

11def start_debugging(wait_for_client: bool) -> None: 

12 import debugpy 

13 

14 debugpy.listen(address=(DEBUG_ADDR, DEBUG_PORT)) 

15 print(f" - Debugging is enabled, listening on: {DEBUG_ADDR}:{DEBUG_PORT}") 

16 

17 if wait_for_client: 

18 print(" - execution paused, waiting for debugger to attach...") 

19 debugpy.wait_for_client() 

20 print(" - debugger is now attached, continuing execution.")