 ;;--------;;
 ;; Python ;;
 ;;--------;;
+;; Use poetry
+(use-package poetry
+  :ensure t)
+
 ;; Use elpy in python mode
 (use-package elpy
-             :init (add-hook 'python-mode-hook '(lambda ()
-                                                  (setq python-indent-offset 4)))
-             :config
-	     (elpy-enable)
-	     (setq elpy-test-django-with-manage t)
-	     (setq elpy-modules (delq 'elpy-module-highlight-indentation elpy-modules))
-	     ;; Permits using pdb.set_trace() when running tests in buffer
-	     (defun elpy-test-run (working-directory command &rest args)
-	       (let ((default-directory working-directory))
-		 (compile (mapconcat #'shell-quote-argument
-				     (cons command args)
-				     " ")
-			  t))))
+  :init
+  (add-hook 'python-mode-hook '(lambda ()
+                                 (setq python-indent-offset 4)))
+  (add-hook 'before-save-hook 'elpy-format-code)
+  :config
+  (elpy-enable)
+  (setq elpy-test-django-with-manage t)
+  (setq elpy-modules (delq 'elpy-module-highlight-indentation elpy-modules))
+  (setq elpy-rpc-virtualenv-path 'current)
+  ;; Permits using pdb.set_trace() when running tests in buffer
+  (defun elpy-test-run (working-directory command &rest args)
+    (let ((default-directory working-directory))
+      (compile (mapconcat #'shell-quote-argument
+                          (cons command args)
+                          " ")
+               t))))
 
 ;; Use isort and auto sort imports on save
 (use-package py-isort

;;-------;;
;; Load custom theme
(load-theme 'se7entyse7en t)
(set-face-attribute 'default nil :height 110)


;;-------;;

;; PATH ;;
;;------;;
(use-package exec-path-from-shell
  :init
  (setq explicit-shell-file-name "zsh")
  (exec-path-from-shell-initialize)
  )


;;----------;;
