Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use rich.traceback with debug mode #10832

Merged
merged 3 commits into from Feb 1, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions news/10791.feature.rst
@@ -0,0 +1 @@
Print the exception via ``rich.traceback``, when running with ``--debug``.
3 changes: 3 additions & 0 deletions src/pip/_internal/cli/base_command.py
Expand Up @@ -10,6 +10,8 @@
from optparse import Values
from typing import Any, Callable, List, Optional, Tuple

from pip._vendor.rich.traceback import install
q0w marked this conversation as resolved.
Show resolved Hide resolved

from pip._internal.cli import cmdoptions
from pip._internal.cli.command_context import CommandContextMixIn
from pip._internal.cli.parser import ConfigOptionParser, UpdatingDefaultsHelpFormatter
Expand Down Expand Up @@ -215,6 +217,7 @@ def exc_logging_wrapper(*args: Any) -> int:
run = intercepts_unhandled_exc(self.run)
else:
run = self.run
install(show_locals=True)
return run(options, args)
finally:
self.handle_pip_version_check(options)