From 354edee92ecd1a2286f8f4afedd30a66a8ccecd0 Mon Sep 17 00:00:00 2001 From: Jeremy Dormitzer Date: Fri, 14 Feb 2020 10:21:53 -0500 Subject: [PATCH] Add function to pip install in the current project --- emacs/init.org | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/emacs/init.org b/emacs/init.org index 14326ba..47fa6d0 100755 --- a/emacs/init.org +++ b/emacs/init.org @@ -4643,6 +4643,25 @@ Some functions to make my day job easier. (leader-def-key "Lr" #'release-manager) #+END_SRC +** Python stuff +Run pip install in the current project: +#+BEGIN_SRC emacs-lisp + (defun pip-install (reqs) + (interactive + (list + (read-file-name "Requirements file: " + (or (projectile-project-root) + default-directory) + nil t "requirements" + (lambda (name) + (string-match-p "requirements.*" + name))))) + (with-temp-buffer + (cd (or (projectile-project-root) + default-directory)) + (compile (format "pip install -r %s" reqs)))) +#+END_SRC + ** AWS-MFA The aws-mfa command: #+BEGIN_SRC emacs-lisp