дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-12-06 01:57:13 +02:00
feat(run): debug Python on SSH run targets (#6696)
Debug on a Python configuration with an SSH run target now starts the program under the debugpy bootstrap listening on the host's loopback interface, forwards a local port through the SSH session and attaches with the project root mapped onto the target folder. When the host's interpreter has no debugpy, the IDE's copy is uploaded once to ~/.openidea/debug/<version> (written to a temporary folder and renamed into place so concurrent runs don't see partial files); without a local copy the error offers to install it. The check times out after 30 s, and the run fails if debugpy is not ready 120 s after start. The launch parameter containerDebug is renamed targetDebug. Closes #6695 Co-authored-by: wildcatDownstairs <[email protected]>
Цей коміт міститься в:
1 джерело
f151498e07
коміт
df40f0befe
25 files changed
+545
-150
No files matched your search
@@ -156,6 +156,7 @@ Python debugging uses debugpy. If it is missing when you start a debug session,
|
||||
|
||||
- Scripts, `python -m` modules and console scripts such as `pytest` or `uvicorn` can be debugged. Programs started through `uv run`, `poetry run`, `pdm run`, `pipenv run`, `hatch run` or `rye run` run in that manager's environment.
|
||||
- Debugging `manage.py` enables Django support in debugpy.
|
||||
- A configuration that runs on an SSH, Docker or Compose run target is debugged there: the program starts under debugpy on the target and the debugger attaches with the project folder mapped onto the target's. On an SSH host, debugpy listens on the host's loopback interface and the IDE connects through the SSH connection. When the host's interpreter has no debugpy, the IDE uploads its own copy to `~/.openidea/debug` on the host (once per debugpy version). As with `debugpy --listen`, other users of the host can connect to that port until the debugger has attached.
|
||||
- **Attach to Process…** (`⌥⇧F5` / `Ctrl+Alt+F5`) lists local Python processes under **Python (debugpy)**.
|
||||
- The **Python Remote Debug (debugpy)** configuration attaches to a process started with `python -m debugpy --listen`, locally or on another machine, with local and remote root mapping.
|
||||
- The **Python Debug Server** configuration works the other way round: the IDE listens and the program connects with `import debugpy; debugpy.connect(("localhost", 5678)); debugpy.wait_for_client()`, from a container or another machine too. Install the IDE debugger's debugpy version where the program runs; the Debug console warns when they differ. A VS Code `attach` with `"listen"` imports as this configuration; its `listen.host` `0.0.0.0` is where VS Code binds, so it imports as `localhost`. For a program in a container or on another machine, set the IDE host name to an address it can reach, such as `host.docker.internal`.
|
||||
|
||||
Reference in new issue
Заблокувати користувача