1 ;;; init-python.el --- Python editing -*- lexical-binding: t -*-
5 ;; I use nix + direnv instead of virtualenv/pyenv/pyvenv, and it is an
6 ;; approach which extends to other languages too. I recorded a
7 ;; screencast about this: https://www.youtube.com/watch?v=TbIHRHy7_JM
11 (append '(("SConstruct\\'" . python-mode
)
12 ("SConscript\\'" . python-mode
))
15 (setq python-shell-interpreter
"python3")
17 (require-package 'pip-requirements
)
19 (when (maybe-require-package 'toml-mode
)
20 (add-to-list 'auto-mode-alist
'("poetry\\.lock\\'" . toml-mode
)))
22 (when (maybe-require-package 'reformatter
)
23 (reformatter-define black
:program
"black" :args
'("-")))
25 (provide 'init-python
)
26 ;;; init-python.el ends here