2015-04-25 03:25:04 +00:00
|
|
|
;;; config.el --- Python Layer Configuration File for Spacemacs
|
2015-01-30 15:30:10 +00:00
|
|
|
;;
|
2018-01-04 07:00:25 +00:00
|
|
|
;; Copyright (c) 2012-2018 Sylvain Benner & Contributors
|
2015-01-30 15:30:10 +00:00
|
|
|
;;
|
|
|
|
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
|
|
|
|
;; URL: https://github.com/syl20bnr/spacemacs
|
|
|
|
;;
|
|
|
|
;; This file is not part of GNU Emacs.
|
|
|
|
;;
|
|
|
|
;;; License: GPLv3
|
|
|
|
|
2015-04-01 02:24:01 +00:00
|
|
|
;; variables
|
|
|
|
|
2016-09-05 02:29:41 +00:00
|
|
|
(spacemacs|define-jump-handlers python-mode)
|
|
|
|
(spacemacs|define-jump-handlers cython-mode anaconda-mode-goto)
|
|
|
|
|
2019-09-30 04:49:44 +00:00
|
|
|
(defvar python-backend 'nil
|
|
|
|
"The backend to use for IDE features.
|
|
|
|
Possible values are `anaconda'and `lsp'.
|
|
|
|
If `nil' then `anaconda' is the default backend unless `lsp' layer is used.")
|
2018-02-19 05:08:27 +00:00
|
|
|
|
2019-01-28 10:47:03 +00:00
|
|
|
(defvar python-lsp-server 'pyls
|
|
|
|
"Language server to use for lsp backend. Possible values are `pyls'
|
|
|
|
and `mspyls'")
|
|
|
|
|
|
|
|
(defvar python-lsp-git-root nil
|
|
|
|
"If non-nil, use a development version of the language server in this folder")
|
|
|
|
|
2018-12-11 21:59:25 +00:00
|
|
|
(defvar python-pipenv-activate nil
|
|
|
|
"If non-nil, activate pipenv before enabling backend")
|
|
|
|
|
2019-12-10 06:59:40 +00:00
|
|
|
(defvar python-formatter nil
|
2019-08-31 21:21:03 +00:00
|
|
|
"The formatter to use. Possible values are `yapf',
|
|
|
|
`black' and 'lsp'.")
|
2018-12-30 17:30:40 +00:00
|
|
|
|
|
|
|
(defvar python-format-on-save nil
|
|
|
|
"If non-nil, automatically format code with formatter selected
|
|
|
|
via `python-formatter' on save.")
|
2015-04-22 04:02:23 +00:00
|
|
|
|
2015-06-08 03:59:23 +00:00
|
|
|
(defvar python-test-runner 'nose
|
|
|
|
"Test runner to use. Possible values are `nose' or `pytest'.")
|
2015-09-21 23:29:23 +00:00
|
|
|
|
2017-12-22 10:16:38 +00:00
|
|
|
(defvar python-save-before-test t
|
|
|
|
"If non nil, current buffer will be save before call a test function")
|
|
|
|
|
2015-09-21 23:29:23 +00:00
|
|
|
(defvar python-fill-column 79
|
|
|
|
"Fill column value for python buffers")
|
2015-12-07 12:58:36 +00:00
|
|
|
|
2016-10-11 18:01:01 +00:00
|
|
|
(defvar python-tab-width 4
|
|
|
|
"Tab width value for python buffers")
|
|
|
|
|
2018-08-25 12:29:51 +00:00
|
|
|
(defvar python-spacemacs-indent-guess t
|
|
|
|
"If non-nil, try to guess correct indentation settings for python buffers on opening")
|
|
|
|
|
2015-12-07 12:58:36 +00:00
|
|
|
(defvar python-auto-set-local-pyenv-version 'on-visit
|
|
|
|
"Automatically set pyenv version from \".python-version\".
|
|
|
|
|
|
|
|
Possible values are `on-visit', `on-project-switch' or `nil'.")
|
2015-11-07 08:28:26 +00:00
|
|
|
|
2016-10-25 17:25:57 +00:00
|
|
|
(defvar python-auto-set-local-pyvenv-virtualenv 'on-visit
|
|
|
|
"Automatically set pyvenv virtualenv from \".venv\".
|
|
|
|
|
|
|
|
Possible values are `on-visit', `on-project-switch' or `nil'.")
|
|
|
|
|
2016-08-21 15:49:20 +00:00
|
|
|
(defvar python-sort-imports-on-save nil
|
2015-11-07 08:28:26 +00:00
|
|
|
"If non-nil, automatically sort imports on save.")
|
2018-05-20 07:06:25 +00:00
|
|
|
|
|
|
|
(defvar spacemacs--python-pyenv-modes nil
|
|
|
|
"List of major modes where to add pyenv support.")
|
|
|
|
|
|
|
|
(defvar spacemacs--python-pyvenv-modes nil
|
|
|
|
"List of major modes where to add pyvenv support.")
|
2018-07-15 03:50:25 +00:00
|
|
|
|
2019-11-16 16:51:49 +00:00
|
|
|
(defvar spacemacs--python-pipenv-modes nil
|
|
|
|
"List of major modes where to add pipenv support.")
|
|
|
|
|
2018-07-15 03:50:25 +00:00
|
|
|
;; inferior-python-mode needs these variables to be defined. The python
|
|
|
|
;; package declares them but does not initialize them.
|
|
|
|
(defvar python-shell--interpreter nil)
|
|
|
|
(defvar python-shell--interpreter-args nil)
|