inducer / pudb

Full-screen console debugger for Python
https://documen.tician.de/pudb/
Other
2.94k stars 226 forks source link

Unable to use `--pdb --pdbcls=pudb.debugger:Debugger` with latest versions of urwid #617

Closed mvanderkamp closed 11 months ago

mvanderkamp commented 11 months ago

Describe the bug I tried using pytest --pdb --pdbcls=pudb.debugger:Debugger and received the following error:

ERROR: --pdbcls: could not import 'pudb.debugger:Debugger': 'urwid.wimp' is not expected to be imported directly. Please use public access from "urwid" package. Module 'urwid.wimp' is deprecated and will be removed in the future.

After downgrading urwid to 2.1.2 it worked again.

This obviously stems from an urwid issue, but there might be a way for us to address it. Unfortunately this doesn't just happen with the latest pudb release, since we don't have an upper bound on which versions of urwid are acceptable, so this can affect users whose setup specifies an old version of pudb but doesn't specify which version of urwid to use. The solution in that case is for those users needing an old pudb version to restrict urwid to <2.2.0.

To Reproduce Steps to reproduce the behavior:

  1. Install pytest. I have version 7.2.1
  2. Do a fresh install of pudb, any recent version will do though. Make sure that the version of urwid that gets installed with it is >=2.0.0.
  3. Try debugging the failing test with pytest --pdb --pdbcls=pudb.debugger:Debugger

Expected behavior The debugger should open on the exception that causes the test to fail.

Versions

inducer commented 11 months ago

Who is importing urwid.wimp? git grep wimp in pudb comes up empty.

mvanderkamp commented 11 months ago

Oh it's an urwid internal import. Fixed but not released: https://github.com/urwid/urwid/issues/644

Guess we can just wait it out for them to release the next version, unless you want to put special handling for versions in setup.py but I'm not sure it's worth it.