Add a note for python configuration

This commit is contained in:
Vedang Manerikar 2024-11-20 09:03:08 +05:30
parent 6193ec3386
commit 64ccd037b4
2 changed files with 8 additions and 10 deletions

View file

@ -4670,7 +4670,12 @@ Prot is the developer of this package.
The built-in Python mode for Emacs goes a long way. We build minimal tooling around this mode, specifically to support ~eglot~ and Python's virtualenv system.
Anytime you create a virtualenv, you should run the following command: =pip3 install ruff python-lsp-server python-lsp-ruff=
Run the following commands to make sure you have the developer dependencies installed globally:
- =pipx= : Installed by =brew install pipx=
- =ruff= : An extremely fast Python linter, and code formatter, written in Rust. Installed by =pipx install ruff=
- Ruff is also a langauge server, but it only provides functionality related to formating and linting. As it adds more over time (like go-to definition), I may make it my primary language server
- =pylsp= : The defacto language server for Python. Install with =pipx install python-lsp-server=
#+begin_src emacs-lisp :tangle "unravel-modules/unravel-langs.el"
;;;; Configuration for Python Programming

View file

@ -346,23 +346,16 @@ Perform the comparison with `string<'."
(use-package python
:ensure nil
:hook
((python-ts-mode . eglot-ensure)
(python-mode . eglot-ensure))
:hook ((python-base-mode . eglot-ensure))
:config
(setq python-shell-dedicated 'project))
(use-package pyvenv
:ensure t
:after python
:commands (pyvenv-create pyvenv-workon pyvenv-activate pyvenv-deactivate)
:config
(setenv "WORKON_HOME" "~/.cache/venvs/")
(pyvenv-tracking-mode 1))
(use-package auto-virtualenv
:ensure t
:config
(setq auto-virtualenv-verbose t)
(auto-virtualenv-setup))
(provide 'unravel-langs)