From 901a8ed928c48ea8bb55b2de169eb775d1176154 Mon Sep 17 00:00:00 2001 From: Tianshu Wang Date: Sun, 19 May 2024 17:17:23 +0800 Subject: [PATCH] Install rich traceback if available --- .gitignore | 6 +++++- config/python/sitecustomize.py | 5 +++++ runcom/dot-zshenv | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 config/python/sitecustomize.py diff --git a/.gitignore b/.gitignore index fe543f5..60ec5fe 100644 --- a/.gitignore +++ b/.gitignore @@ -17,4 +17,8 @@ ### ZSH ### *.zwc -.zprofile \ No newline at end of file +.zprofile + +### Python ### +# Byte-compiled / optimized / DLL files +__pycache__/ diff --git a/config/python/sitecustomize.py b/config/python/sitecustomize.py new file mode 100644 index 0000000..186c412 --- /dev/null +++ b/config/python/sitecustomize.py @@ -0,0 +1,5 @@ +try: + from rich.traceback import install + install(show_locals=True) +except ImportError: + pass diff --git a/runcom/dot-zshenv b/runcom/dot-zshenv index a8a6083..8b2560a 100644 --- a/runcom/dot-zshenv +++ b/runcom/dot-zshenv @@ -70,6 +70,7 @@ export MACHINE_STORAGE_PATH=$XDG_DATA_HOME/docker-machine export NPM_CONFIG_USERCONFIG=$XDG_CONFIG_HOME/npm/npmrc export PIPX_HOME=$XDG_DATA_HOME/pipx export PYTHONSTARTUP=$XDG_CONFIG_HOME/python/pythonrc +export PYTHONPATH=$XDG_CONFIG_HOME/python${PYTHONPATH:+":$PYTHONPATH"} export RIPGREP_CONFIG_PATH=$XDG_CONFIG_HOME/ripgrep/ripgreprc export RUFF_CACHE_DIR=$XDG_CACHE_HOME/ruff export VIMINIT="set nocp | source $XDG_CONFIG_HOME/vim/vimrc"