2018-05-15 13:50:58 +02:00
|
|
|
;;; lang/python/doctor.el -*- lexical-binding: t; -*-
|
|
|
|
|
2022-08-12 20:29:19 +02:00
|
|
|
(assert! (or (not (modulep! +lsp))
|
|
|
|
(modulep! :tools lsp))
|
2019-04-22 03:10:25 -04:00
|
|
|
"This module requires (:tools lsp)")
|
|
|
|
|
2022-08-12 20:29:19 +02:00
|
|
|
(assert! (or (not (modulep! +tree-sitter))
|
|
|
|
(modulep! :tools tree-sitter))
|
2021-10-19 19:26:26 +01:00
|
|
|
"This module requires (:tools tree-sitter)")
|
|
|
|
|
2020-12-12 00:55:43 -05:00
|
|
|
(if (not (or (executable-find "python")
|
|
|
|
(executable-find "python3")))
|
2020-05-15 01:44:53 -04:00
|
|
|
(error! "Couldn't find python in your PATH")
|
2022-08-12 20:29:19 +02:00
|
|
|
(unless (modulep! +lsp)
|
2020-12-12 00:55:43 -05:00
|
|
|
(unless (or (zerop (shell-command "python -c 'import setuptools'"))
|
|
|
|
(zerop (shell-command "python3 -c 'import setuptools'")))
|
2019-04-22 03:10:25 -04:00
|
|
|
(warn! "setuptools wasn't detected, which anaconda-mode requires"))))
|
2018-05-15 13:50:58 +02:00
|
|
|
|
2022-08-12 20:29:19 +02:00
|
|
|
(when (modulep! +pyenv)
|
2018-08-02 00:13:00 +02:00
|
|
|
(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?"))))
|
|
|
|
|
2022-08-12 20:29:19 +02:00
|
|
|
(when (modulep! +conda)
|
2018-08-02 00:13:00 +02:00
|
|
|
(unless (executable-find "conda")
|
|
|
|
(warn! "Couldn't find conda in your PATH")))
|
|
|
|
|
2022-08-12 20:29:19 +02:00
|
|
|
(when (modulep! +poetry)
|
2020-04-22 20:48:00 +03:00
|
|
|
(if (not (executable-find "poetry"))
|
|
|
|
(warn! "Couldn't find poetry in your PATH")))
|
|
|
|
|
2022-08-12 20:29:19 +02:00
|
|
|
(when (modulep! +cython)
|
2020-01-24 12:23:45 -05:00
|
|
|
(unless (executable-find "cython")
|
|
|
|
(warn! "Couldn't find cython. cython-mode will not work.")))
|
|
|
|
|
2022-08-12 20:29:19 +02:00
|
|
|
(when (modulep! +ipython)
|
2018-08-02 00:13:00 +02:00
|
|
|
(unless (executable-find "ipython")
|
|
|
|
(warn! "Couldn't find ipython in your PATH")))
|
2020-01-24 12:23:45 -05:00
|
|
|
|
2020-02-10 22:04:08 -05:00
|
|
|
(unless (executable-find "pytest")
|
|
|
|
(warn! "Couldn't find pytest. Running tests through pytest will not work."))
|
2020-01-24 12:23:45 -05:00
|
|
|
|
2020-02-10 22:04:08 -05:00
|
|
|
(unless (executable-find "nosetests")
|
|
|
|
(warn! "Couldn't find nosetests. Running tests through nose will not work."))
|
2020-01-24 12:23:45 -05:00
|
|
|
|
2020-02-10 22:04:08 -05:00
|
|
|
(unless (executable-find "pipenv")
|
|
|
|
(warn! "Couldn't find pipenv. pipenv support will not work."))
|
2020-01-24 12:23:45 -05:00
|
|
|
|
2020-02-10 22:04:08 -05:00
|
|
|
(unless (executable-find "isort")
|
|
|
|
(warn! "Couldn't find isort. Import sorting will not work."))
|
2020-01-24 12:23:45 -05:00
|
|
|
|
2022-08-12 20:29:19 +02:00
|
|
|
(when (modulep! :editor format)
|
2020-02-10 19:55:49 -05:00
|
|
|
(unless (executable-find "pyflakes")
|
2020-01-24 12:23:45 -05:00
|
|
|
(warn! "Couldn't find pyflakes. Import management will not work."))
|
2020-02-10 19:55:49 -05:00
|
|
|
(unless (executable-find "black")
|
|
|
|
(warn! "Couldn't find black. Code formatting will not work.")))
|