diff --git a/requirements/development.txt b/requirements/development.txt index 1c627c1..43661f8 100644 --- a/requirements/development.txt +++ b/requirements/development.txt @@ -14,11 +14,10 @@ pudb # https://pypi.org/project/q/ q -# backtrace manipulates Python tracebacks to make them more -# readable. It provides different configuration options for -# coloring and formatting. +# rich is used for more readable tracebacks during development # https://github.com/nir0s/backtrace -backtrace +# https://rich.readthedocs.io/en/latest/traceback.html +rich # Py-Spy: A sampling profiler for Python programs. # https://github.com/benfred/py-spy diff --git a/src/pycalver/cli.py b/src/pycalver/cli.py index 682f949..c9b5731 100755 --- a/src/pycalver/cli.py +++ b/src/pycalver/cli.py @@ -26,13 +26,14 @@ _VERBOSE = 0 # To enable pretty tracebacks: -# echo "export ENABLE_BACKTRACE=1;" >> ~/.bashrc -if os.environ.get('ENABLE_BACKTRACE') == '1': +# echo "export ENABLE_RICH_TB=1;" >> ~/.bashrc +if os.environ.get('ENABLE_RICH_TB') == '1': try: - import backtrace + import rich.traceback - backtrace.hook(align=True, strip_path=True, enable_on_envvar_only=True) + rich.traceback.install() except ImportError: + # don't fail just because of missing dev library pass