You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow explicitly mark paths as library to exclude from 'justMyCode' #1914
Here's the situation: I'm debugging some Python code that relies on third-party libraries. The third-party libraries (unfortunately) are installed by a non-standard package manager and are under some subdirectory in the ./shared folder of the conda env. I'm trying to debug unit tests but the debugger constantly breaks into the third-party library on certain exceptions when the 'User Uncaught Exceptions' option is ticked. The exception in the third-party lib are actually handled by the standard lib somewhere so they never bubble up to my code, yet the debugger breaks every time. This is very annoying because I only want to break into the debugger on exception raised from my own code. I've tries setting PYDEVD_FILTERS and LIBRARY_ROOTS, that I found in the source code but neither worked.
Maybe if you added those paths to the PYTHONPATH variable? That might make pydevd consider them third party.
They're added to PYTHONPATH, that's how the third-party package manager works. Actually, when you develop a Python module, you have to add your own module to PYTHONPATH as well, so that's not a good way of making a distinction.
Activity
dobos commentedon Jun 24, 2025
Path filtering seems to be implemented here: https://github.com/microsoft/debugpy/blob/main/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_filtering.py
rchiodo commentedon Jun 24, 2025
Maybe if you added those paths to the PYTHONPATH variable? That might make pydevd consider them third party.
rchiodo commentedon Jun 24, 2025
Otherwise, the rules as documented in the other issue should work.
dobos commentedon Jun 25, 2025
They're added to PYTHONPATH, that's how the third-party package manager works. Actually, when you develop a Python module, you have to add your own module to PYTHONPATH as well, so that's not a good way of making a distinction.