- Python 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .gitea/workflows | ||
| src/nxdebugger | ||
| tests | ||
| .gitignore | ||
| .python-version | ||
| LICENSE | ||
| pyproject.toml | ||
| README.md | ||
| uv.lock | ||
Debugging NX with VS Code
This debugger communicates with VS Code directly through the Debug Adapter
Protocol (DAP). It does not load debugpy, pydevd, Cython extensions, or
debugger background threads into the NX process. This makes it suitable for the
short-lived Python subinterpreter used by the NX MOM adapter.
Start
- Close every running NX process. This is important after an earlier
debugpyprocess-ID attach because its modules remain loaded until that process exits. - Start the post run in NX.
MOM_start_of_programwaits up to 60 seconds for VS Code. - Open Run and Debug in VS Code, select
NX: Thread-free DAP Debugger, and press
F5. - Set breakpoints in the post file or imported Python modules.
To post normally, start NX without NX_DAP_DEBUG=1. No port is opened and
the post does not wait for a debugger in that mode.
Supported features
- Breakpoints, conditions, hit conditions, and logpoints
- Continue, Step Into, Step Over, and Step Out
- Call Stack, Locals, Globals, and nested values
- Watch expressions and Debug Console evaluation
- Break on raised Python exceptions
- Synchronous cleanup from
MOM_end_of_programand throughatexit
Limitations
The adapter deliberately operates only on the current MOM Python thread. A Pause request is therefore processed at the next Python trace event. Python cannot be interrupted immediately while NX spends a long time in native C/C++ code. The initial implementation supports one Python thread.
Diagnostics are written to nx_dap_debugger.log next to the debugger files.
Package releases
Gitea Actions tests and builds the package on pull requests. Publishing a Gitea
release additionally publishes the distributions to the Gitea PyPI registry.
The package version is taken from the release tag; both v0.1.0 and 0.1.0
result in package version 0.1.0.
Push the release tag without changing the version in pyproject.toml:
Then create and publish a Gitea release for that tag. Draft releases do not publish a package.
Before publishing, create a personal access token for the repository owner with
the write:package scope and store it as the repository Actions secret
PYPI_TOKEN.