refactor: deprecate featurep! for modulep!
featurep! will be renamed modulep! in the future, so it's been deprecated. They have identical interfaces, and can be replaced without issue. featurep! was never quite the right name for this macro. It implied that it had some connection to featurep, which it doesn't (only that it was similar in purpose; still, Doom modules are not features). To undo such implications and be consistent with its namespace (and since we're heading into a storm of breaking changes with the v3 release anyway), now was the best opportunity to begin the transition.
This commit is contained in:
parent
0407621aff
commit
ad6a3d0f33
316 changed files with 1109 additions and 1103 deletions
|
@ -1,5 +1,5 @@
|
|||
;;; lang/python/autoload/conda.el -*- lexical-binding: t; -*-
|
||||
;;;###if (featurep! +conda)
|
||||
;;;###if (modulep! +conda)
|
||||
|
||||
;;;###autoload
|
||||
(defun +python/set-conda-home ()
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
;;; lang/python/autoload/pyenv.el -*- lexical-binding: t; -*-
|
||||
;;;###if (featurep! +pyenv)
|
||||
;;;###if (modulep! +pyenv)
|
||||
|
||||
;;;###autoload
|
||||
(defvar +pyenv--version nil)
|
||||
|
|
|
@ -20,13 +20,13 @@
|
|||
(setq python-environment-directory doom-cache-dir
|
||||
python-indent-guess-indent-offset-verbose nil)
|
||||
|
||||
(when (featurep! +lsp)
|
||||
(when (modulep! +lsp)
|
||||
(add-hook 'python-mode-local-vars-hook #'lsp! 'append)
|
||||
;; Use "mspyls" in eglot if in PATH
|
||||
(when (executable-find "Microsoft.Python.LanguageServer")
|
||||
(set-eglot-client! 'python-mode '("Microsoft.Python.LanguageServer"))))
|
||||
|
||||
(when (featurep! +tree-sitter)
|
||||
(when (modulep! +tree-sitter)
|
||||
(add-hook 'python-mode-local-vars-hook #'tree-sitter! 'append))
|
||||
:config
|
||||
(set-repl-handler! 'python-mode #'+python/open-repl
|
||||
|
@ -82,7 +82,7 @@
|
|||
(setq-local flycheck-python-flake8-executable "flake8"))))
|
||||
|
||||
;; Affects pyenv and conda
|
||||
(when (featurep! :ui modeline)
|
||||
(when (modulep! :ui modeline)
|
||||
(advice-add #'pythonic-activate :after-while #'+modeline-update-env-in-all-windows-h)
|
||||
(advice-add #'pythonic-deactivate :after #'+modeline-clear-env-in-all-windows-h))
|
||||
|
||||
|
@ -311,7 +311,7 @@
|
|||
(use-package! pyvenv
|
||||
:after python
|
||||
:init
|
||||
(when (featurep! :ui modeline)
|
||||
(when (modulep! :ui modeline)
|
||||
(add-hook 'pyvenv-post-activate-hooks #'+modeline-update-env-in-all-windows-h)
|
||||
(add-hook 'pyvenv-pre-deactivate-hooks #'+modeline-clear-env-in-all-windows-h))
|
||||
:config
|
||||
|
@ -323,7 +323,7 @@
|
|||
|
||||
|
||||
(use-package! pyenv-mode
|
||||
:when (featurep! +pyenv)
|
||||
:when (modulep! +pyenv)
|
||||
:after python
|
||||
:config
|
||||
(when (executable-find "pyenv")
|
||||
|
@ -334,7 +334,7 @@
|
|||
|
||||
|
||||
(use-package! conda
|
||||
:when (featurep! +conda)
|
||||
:when (modulep! +conda)
|
||||
:after python
|
||||
:config
|
||||
;; The location of your anaconda home will be guessed from a list of common
|
||||
|
@ -373,7 +373,7 @@
|
|||
|
||||
|
||||
(use-package! poetry
|
||||
:when (featurep! +poetry)
|
||||
:when (modulep! +poetry)
|
||||
:after python
|
||||
:init
|
||||
(setq poetry-tracking-strategy 'switch-buffer)
|
||||
|
@ -381,7 +381,7 @@
|
|||
|
||||
|
||||
(use-package! cython-mode
|
||||
:when (featurep! +cython)
|
||||
:when (modulep! +cython)
|
||||
:mode "\\.p\\(yx\\|x[di]\\)\\'"
|
||||
:config
|
||||
(setq cython-default-compile-format "cython -a %s")
|
||||
|
@ -392,8 +392,8 @@
|
|||
|
||||
|
||||
(use-package! flycheck-cython
|
||||
:when (featurep! +cython)
|
||||
:when (featurep! :checkers syntax)
|
||||
:when (modulep! +cython)
|
||||
:when (modulep! :checkers syntax)
|
||||
:after cython-mode)
|
||||
|
||||
|
||||
|
@ -418,16 +418,16 @@
|
|||
;;
|
||||
;;; LSP
|
||||
|
||||
(eval-when! (and (featurep! +lsp)
|
||||
(not (featurep! :tools lsp +eglot)))
|
||||
(eval-when! (and (modulep! +lsp)
|
||||
(not (modulep! :tools lsp +eglot)))
|
||||
|
||||
(use-package! lsp-python-ms
|
||||
:unless (featurep! +pyright)
|
||||
:unless (modulep! +pyright)
|
||||
:after lsp-mode
|
||||
:preface
|
||||
(after! python
|
||||
(setq lsp-python-ms-python-executable-cmd python-shell-interpreter)))
|
||||
|
||||
(use-package! lsp-pyright
|
||||
:when (featurep! +pyright)
|
||||
:when (modulep! +pyright)
|
||||
:after lsp-mode))
|
||||
|
|
|
@ -1,40 +1,40 @@
|
|||
;;; lang/python/doctor.el -*- lexical-binding: t; -*-
|
||||
|
||||
(assert! (or (not (featurep! +lsp))
|
||||
(featurep! :tools lsp))
|
||||
(assert! (or (not (modulep! +lsp))
|
||||
(modulep! :tools lsp))
|
||||
"This module requires (:tools lsp)")
|
||||
|
||||
(assert! (or (not (featurep! +tree-sitter))
|
||||
(featurep! :tools tree-sitter))
|
||||
(assert! (or (not (modulep! +tree-sitter))
|
||||
(modulep! :tools tree-sitter))
|
||||
"This module requires (:tools tree-sitter)")
|
||||
|
||||
(if (not (or (executable-find "python")
|
||||
(executable-find "python3")))
|
||||
(error! "Couldn't find python in your PATH")
|
||||
(unless (featurep! +lsp)
|
||||
(unless (modulep! +lsp)
|
||||
(unless (or (zerop (shell-command "python -c 'import setuptools'"))
|
||||
(zerop (shell-command "python3 -c 'import setuptools'")))
|
||||
(warn! "setuptools wasn't detected, which anaconda-mode requires"))))
|
||||
|
||||
(when (featurep! +pyenv)
|
||||
(when (modulep! +pyenv)
|
||||
(if (not (executable-find "pyenv"))
|
||||
(warn! "Couldn't find pyenv in your PATH")
|
||||
(unless (split-string (shell-command-to-string "pyenv versions --bare") "\n" t)
|
||||
(warn! "No versions of python are available via pyenv, did you forget to install one?"))))
|
||||
|
||||
(when (featurep! +conda)
|
||||
(when (modulep! +conda)
|
||||
(unless (executable-find "conda")
|
||||
(warn! "Couldn't find conda in your PATH")))
|
||||
|
||||
(when (featurep! +poetry)
|
||||
(when (modulep! +poetry)
|
||||
(if (not (executable-find "poetry"))
|
||||
(warn! "Couldn't find poetry in your PATH")))
|
||||
|
||||
(when (featurep! +cython)
|
||||
(when (modulep! +cython)
|
||||
(unless (executable-find "cython")
|
||||
(warn! "Couldn't find cython. cython-mode will not work.")))
|
||||
|
||||
(when (featurep! +ipython)
|
||||
(when (modulep! +ipython)
|
||||
(unless (executable-find "ipython")
|
||||
(warn! "Couldn't find ipython in your PATH")))
|
||||
|
||||
|
@ -50,7 +50,7 @@
|
|||
(unless (executable-find "isort")
|
||||
(warn! "Couldn't find isort. Import sorting will not work."))
|
||||
|
||||
(when (featurep! :editor format)
|
||||
(when (modulep! :editor format)
|
||||
(unless (executable-find "pyflakes")
|
||||
(warn! "Couldn't find pyflakes. Import management will not work."))
|
||||
(unless (executable-find "black")
|
||||
|
|
|
@ -3,31 +3,31 @@
|
|||
|
||||
;; Major modes
|
||||
(package! pip-requirements :pin "216cd1690f80cc965d4ae47b8753fc185f778ff6")
|
||||
(when (featurep! +cython)
|
||||
(when (modulep! +cython)
|
||||
(package! cython-mode :pin "8afd932c28d08428d45bba03d6b642093e4c973b")
|
||||
(when (featurep! :checkers syntax)
|
||||
(when (modulep! :checkers syntax)
|
||||
(package! flycheck-cython :pin "ecc4454d35ab5317ab66a04406f36f0c1dbc0b76")))
|
||||
|
||||
;; LSP
|
||||
(when (featurep! +lsp)
|
||||
(unless (featurep! :tools lsp +eglot)
|
||||
(if (featurep! +pyright)
|
||||
(when (modulep! +lsp)
|
||||
(unless (modulep! :tools lsp +eglot)
|
||||
(if (modulep! +pyright)
|
||||
(package! lsp-pyright :pin "c745228f39fdb35372b29b909f25fa6c98dc7c88")
|
||||
(package! lsp-python-ms :pin "f8e7c4bcaefbc3fd96e1ca53d17589be0403b828"))))
|
||||
|
||||
;; Programming environment
|
||||
(package! anaconda-mode :pin "160e4e7185881233d96da6722332bd6d038187a9")
|
||||
(when (featurep! :completion company)
|
||||
(when (modulep! :completion company)
|
||||
(package! company-anaconda :pin "da1566db41a68809ef7f91ebf2de28118067c89b"))
|
||||
|
||||
;; Environment management
|
||||
(package! pipenv :pin "3af159749824c03f59176aff7f66ddd6a5785a10")
|
||||
(package! pyvenv :pin "31ea715f2164dd611e7fc77b26390ef3ca93509b")
|
||||
(when (featurep! +pyenv)
|
||||
(when (modulep! +pyenv)
|
||||
(package! pyenv-mode :pin "b818901b8eac0e260ced66a6a5acabdbf6f5ba99"))
|
||||
(when (featurep! +conda)
|
||||
(when (modulep! +conda)
|
||||
(package! conda :pin "a65ed0084876366fd1b238bb2b8b36ee75ac98d8"))
|
||||
(when (featurep! +poetry)
|
||||
(when (modulep! +poetry)
|
||||
(package! poetry :pin "5b9ef569d629d79820e73b5380e54e443ba90616"))
|
||||
|
||||
;; Testing frameworks
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue