-
Emacs의 Python3 개발 환경Programmer/Emacs 2017. 12. 14. 15:10
emacs의 python 개발 환경은 크게 두 가지가 유명하다.
하나는 elpy 나머지 하나는 anaconda이다.이 두가지 중에 하나를 선택해서 사용한다.
elpy
한마디로, emacs에서 python 개발을 위한 all in one 패키지이다.
설치와 설정이 매우 쉬운면서 여느 IDE와 견주어도 꿀리지 않는 강력함이 있다.(use-package elpy :ensure t :config (elpy-enable) (setq elpy-rpc-python-command "python3") (setq elpy-rpc-backend "jedi") (elpy-use-cpython (or (executable-find "python3") (executable-find "/usr/bin/python3") (executable-find "/usr/local/bin/python3") "python3")) ;; (elpy-use-ipython) (setq python-shell-interpreter-args "--simple-prompt -i") (add-hook 'python-mode-hook (lambda () (setq indent-tabs-mode nil)))) (use-package ein :ensure t)
anaconda
anaconda 최대한 작은 것을 지향한다.
elpy가 자동으로 해주던 것을 일일이 설치하고 설정해야 한다.python-mode
(use-package python :mode ("\\.py\\'" . python-mode) ("\\.wsgi$" . python-mode) :interpreter ("python" . python-mode) :init (setq-default indent-tabs-mode nil) :config (setq python-indent-offset 4) ;; TODO pyvenv (setq flycheck-python-pycompile-executable (or (executable-find "python3") (executable-find "/usr/bin/python3") (executable-find "/usr/local/bin/python3") "python")) (setq flycheck-python-pylint-executable (or (executable-find "pylint3") (executable-find "/usr/bin/pylint3") (executable-find "/usr/local/bin/pylint3") "pyline")) (setq flycheck-python-flake8-executable (or (executable-find "flake8") (executable-find "/usr/bin/flake8") (executable-find "/usr/local/bin/flake8") "flake8")))
anaconda-mode
(use-package anaconda-mode :ensure t :diminish anaconda-mode :defer t :init (progn (add-hook 'python-mode-hook #'anaconda-mode) (add-hook 'python-mode-hook #'anaconda-eldoc-mode))) (use-package company-anaconda :ensure t :commands (company-anaconda) :after company :init (add-to-list 'company-backends #'company-anaconda))
unit test
(use-package nose :commands (nosetests-one nosetests-pdb-one nosetests-all nosetests-pdb-all nosetests-module nosetests-pdb-module nosetests-suite nosetests-pdb-suite) :config (progn (add-to-list 'nose-project-root-files "setup.cfg") (setq nose-use-verbose nil))) (use-package pytest :commands (pytest-one pytest-pdb-one pytest-all pytest-pdb-all pytest-module pytest-pdb-module) :config (add-to-list 'pytest-project-root-files "setup.cfg"))
virtualenv
(use-package pyenv-mode :if (executable-find "pyenv") :commands (pyenv-mode-versions)) (use-package pyvenv :defer t)
'Programmer > Emacs' 카테고리의 다른 글
날아갈 듯 가벼운 mg 편집기 (1) 2019.02.28 Github에서 분기(fork)한 저장소를 Magit으로 원본과 동기화하기 (1) 2019.02.19 Emacs의 Programming 관련 공통 설정 (0) 2017.12.14 Emacs의 Scala 개발 환경 (1) 2017.12.14 Lisp 비교 : Emacs의 개발 환경 (0) 2017.07.11 댓글