Set Pipenv env vars to simplify setup

This commit is contained in:
Jeremy Dormitzer 2020-04-28 14:38:50 -04:00
parent 02d97f2b2f
commit 02007b37f2
2 changed files with 5 additions and 25 deletions

View File

@ -37,3 +37,6 @@ fi
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
export PIPENV_VERBOSITY=-1
export PIPENV_DONT_LOAD_ENV=1

View File

@ -142,7 +142,8 @@ I don't want anything to write to my init.el, so save customizations in a separa
:if (memq window-system '(mac ns x))
:config
(setq exec-path-from-shell-variables '("PATH" "MANPATH" "LEDGER_FILE" "LOLA_HOME"
"MODELS_HOME" "LOLA_TRAVEL_SERVICE_HOME" "WORKON_HOME")
"MODELS_HOME" "LOLA_TRAVEL_SERVICE_HOME" "WORKON_HOME"
"PIPENV_VERBOSITY" "PIPENV_DONT_LOAD_ENV")
exec-path-from-shell-check-startup-files nil)
(exec-path-from-shell-initialize))
#+END_SRC
@ -2962,30 +2963,6 @@ Use the LSP python client:
(general-def 'normal python-mode-map "C-c C-d" #'lsp-describe-thing-at-point)
#+END_SRC
Fix the doom-modeline Python display for Pipenv projects:
#+BEGIN_SRC emacs-lisp
(with-eval-after-load 'doom-modeline-env
(doom-modeline-def-env python
:hooks 'python-mode-hook
:command (lambda ()
(let ((old (getenv "PIPENV_VERBOSITY")))
(setenv "PIPENV_VERBOSITY" "-1")
(cond ((and (fboundp 'pipenv-project-p)
(pipenv-project-p))
(list "pipenv" "run"
(or doom-modeline-env-python-executable
python-shell-interpreter
"python")
"--version"))
((list (or doom-modeline-env-python-executable
python-shell-interpreter
"python")
"--version")))
(setenv "PIPENV_VERBOSITY" old)))
:parser (lambda (line) (cadr (split-string line)))))
#+END_SRC
** Autoflake
[[https://pypi.org/project/autoflake/][Autoflake]] is a tool that removes unused imports and variables from Python code:
#+BEGIN_SRC emacs-lisp