mirror of
https://github.com/TECHNOFAB11/bumpver.git
synced 2025-12-13 06:50:08 +01:00
replace backtrace with rich
This commit is contained in:
parent
77e99837c9
commit
924fc77370
2 changed files with 8 additions and 8 deletions
|
|
@ -14,11 +14,10 @@ pudb
|
||||||
# https://pypi.org/project/q/
|
# https://pypi.org/project/q/
|
||||||
q
|
q
|
||||||
|
|
||||||
# backtrace manipulates Python tracebacks to make them more
|
# rich is used for more readable tracebacks during development
|
||||||
# readable. It provides different configuration options for
|
|
||||||
# coloring and formatting.
|
|
||||||
# https://github.com/nir0s/backtrace
|
# https://github.com/nir0s/backtrace
|
||||||
backtrace
|
# https://rich.readthedocs.io/en/latest/traceback.html
|
||||||
|
rich
|
||||||
|
|
||||||
# Py-Spy: A sampling profiler for Python programs.
|
# Py-Spy: A sampling profiler for Python programs.
|
||||||
# https://github.com/benfred/py-spy
|
# https://github.com/benfred/py-spy
|
||||||
|
|
|
||||||
|
|
@ -26,13 +26,14 @@ _VERBOSE = 0
|
||||||
|
|
||||||
|
|
||||||
# To enable pretty tracebacks:
|
# To enable pretty tracebacks:
|
||||||
# echo "export ENABLE_BACKTRACE=1;" >> ~/.bashrc
|
# echo "export ENABLE_RICH_TB=1;" >> ~/.bashrc
|
||||||
if os.environ.get('ENABLE_BACKTRACE') == '1':
|
if os.environ.get('ENABLE_RICH_TB') == '1':
|
||||||
try:
|
try:
|
||||||
import backtrace
|
import rich.traceback
|
||||||
|
|
||||||
backtrace.hook(align=True, strip_path=True, enable_on_envvar_only=True)
|
rich.traceback.install()
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
# don't fail just because of missing dev library
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue