Install rich.traceback globally for a venv #1553
-
I recently discovered the Rich library - fantastic stuff. I do a lot of simple CLI work and am investigating how I can use it with Click effectively. In the meantime, I have an immediate use case for Rich, the traceback module. It is wonderful. I currently use pretty errors to nicely format all unhandled exceptions by installing it globally in my virtual environment. I have a set of makefiles that handles this automatically. Looking at what pretty errors does, it basically installs to
That seems to apply the traceback to all unhandled exceptions! I thought I would share in case anyone else is looking for this particular use case. I have a lot of repos for experimental and prototype code. This use case works well for me. Are there any problems that could occur by doing this? I was wondering how much effort it would be to properly allow Rich to install itself that way? There might be more use cases that it could deal with in this fashion. For now, I am quite happy to modify my makefiles to do this. Thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
That’s a fine solution. As far as I can tell pretty errors is doing much the same thing. Not sure if I would want to do the automatic install to Rich. That seems to be beyond the remit of a library. Documenting the process in the docs may be a decent compromise. |
Beta Was this translation helpful? Give feedback.
-
I have a similar doubt and was wondering if the opinion on the matter has changed since, namely regarding the part
Is manually amending the file Wouldn't the idea of a "rich configuration file" be a good solution for such matters, namely something along the lines of a project-specific [traceback]
global = true
exclude = 'test/test_*.py'
[print_json]
global = true that takes on specifics for all the methods that |
Beta Was this translation helpful? Give feedback.
That’s a fine solution. As far as I can tell pretty errors is doing much the same thing.
Not sure if I would want to do the automatic install to Rich. That seems to be beyond the remit of a library. Documenting the process in the docs may be a decent compromise.