red-furniture-27218
05/30/2024, 4:33 PMimport debugpy
debugpy.listen(("localhost", 5678))
print("Waiting for debugger attach...")
debugpy.wait_for_client() # Only include this line if you want the script to pause until the debugger is attached.
print("Debugger attached."
set up the configuration and attached.
Breakpoints are skipped and I see
pulumi:pulumi:Stack (app-dev):
0.00s - Debugger warning: It seems that frozen modules are being used, which may
0.00s - make the debugger miss breakpoints. Please pass -Xfrozen_modules=off
0.00s - to python to disable frozen modules.
0.00s - Note: Debugging will proceed. Set PYDEVD_DISABLE_FILE_VALIDATION=1 to disable this validation.
asked ChatGPT for suggestion with Pulumi and it hallucinated the --exec option. which aparently does not exist..
PYTHONPATH=$(python -c "import sys; print(':'.join(sys.path))") pulumi up --exec "python -Xfrozen_modules=off __main__.py"
Any pointers ?? thank youwhite-camera-67848
06/05/2024, 1:46 PMnodeargs
option https://www.pulumi.com/docs/concepts/projects/project-file/#runtime-options
Consider creating a feature request on https://github.com/pulumi/pulumi to get something similar added for python.adventurous-butcher-54166
06/06/2024, 4:11 PMadventurous-butcher-54166
06/06/2024, 4:12 PMadventurous-butcher-54166
06/06/2024, 4:12 PMadventurous-butcher-54166
06/06/2024, 4:18 PMPULUMI_DEBUG=true
and the Python entrypoint uses that to determine whether to start a debugpy session. I include this conditional check in all my Pulumi entrypoints as it won't interrupt operations when I don't want debug mode.
Native VScode (UI) breakpoints are working 99% of the time but in some rare cases I've had to explicitly insert a debugpy.breakpoint()
line where I want the debugger to break.red-furniture-27218
06/06/2024, 11:11 PM"pathMappings": [
{
"localRoot": "${workspaceFolder}/awsx",
"remoteRoot": "."
}
great-sunset-355
06/12/2024, 7:16 AM