Skip to content
Anoncheg1 edited this page May 19, 2023 · 24 revisions

jedi-core configuration without jedi:install-server, pinned versions of dependencies with hash checking

Both emacs-jedi and jedi-company uses jedi-core. jedi-core have reqirements in .emacs.d/elpa/jedi-core-0.2.8/setup.py . This versions is not pinned and jedi:install-server couse pip to install unsecure binary packages of last versions. According to https://pip.pypa.io/en/latest/topics/secure-installs/ versions must be pinned and hashes should be checked.

"jedi>=0.11.0",
"epc>=0.0.4",
"argparse"

We can do it if we will not call jedi:install-server and install dependencies manually as follows.

requirements.txt

jedi==0.17.1 --hash=sha512:b86297b2fbb212695469b34288836e3346a33c5c6b83337dbe4ceaaeb2b4185dcb6c888336e24f6da3fe22a39c803af5c34ae5a4ed1d177fde1c1d7fc143bf09
parso==0.7.1 --hash=sha512:19c30d07a8982323ffbeba3fa36c8f504f49991c54df595e47defca1b1ba94ab3f5203485e6459012adfd440cc648dd8cfd44c571f02db7ed8e49f372eb3df3a
epc==0.0.5 --hash=sha512:e2b75850e39bb0f3c16f5b84f55dec675a8fe2b61ff5fd55704ef677317d698865a99fc495247cd753a2c8329729f45bc7f81f42dd4c6d27b31810c0aac831e2
sexpdata==0.0.3 --hash=sha512:419fa731fb0b953c404a71f1b5f88777546405618913b1d2e4abab7a876d285d43cd035addffb9d221571214e00151e908e8ef6b99295dacee8ca3f4c8ba942e

pip install --no-cache-dir --no-binary=:all: --require-hashes --user -r requirements.txt

If you already have jedi and parso packages installed and require only epc and sexpdata:

mkdir -p ~/.local/lib/python3.11/site-packages
git clone https://github.com/tkf/python-epc.git
git checkout v0.0.5
cp -r python-epc/epc ~/.local/lib/python3.11/site-packages/
git clone https://github.com/jd-boyd/sexpdata.git
git checkout v1.0.0
cp sexpdata/sexpdata.py ~/.local/lib/python3.11/site-packages/
export PATH=$PATH:/home/u/.local/lib/python3.11/site-packages

.emacs:

(with-eval-after-load 'jedi-core
  (setq jedi:environment-virtualenv (list (expand-file-name "/home/<user>/.local/lib/python3.10/site-packages"))))

show-doc open/close by one key

(with-eval-after-load 'jedi-core
  (local-set-key (kbd "C-q") '(lambda ()
				(interactive)
				(if (null (one-window-p))
				  ;; then
				  (delete-other-windows)
				  ;; else
				  (jedi:show-doc))
				))
)