Hi,
For anyone else looking for this - the answer is in the help page:
https://pro.arcgis.com/en/pro-app/arcpy/get-started/debugging-python-code.htm
Debug Python toolboxes
IDEs can only debug Python files (.py). For code in a Python toolbox (.pyt file), copy the code to an external Python file, and replace the code in the Python toolbox with the example below. You can then open the Python file in your IDE and set breakpoints, attach the IDE to ArcGIS Pro, and use your Python toolbox. Upon completion of code modification, copy the contents of the Python file back into the Python toolbox.
In the following example, pyt_code.py contains the code usually found in the Python toolbox and is saved to the same directory as a .pyt file.
The section at the top is a bit misleading as it says
Microsoft Visual Studio IDE
Debugging method | Attach to running processes |
---|
Supported ArcGIS Pro components | - Script tools execution
- Script tool validation
- Python toolboxes
|
so it really should link to the bottom of the page.
Anyway works as expected.