vimPlugins.chadtree: add python dependencies

+52
+11
pkgs/applications/editors/vim/plugins/overrides.nix
··· 149 149 }; 150 150 }; 151 151 152 + chadtree = super.chadtree.overrideAttrs { 153 + passthru.python3Dependencies = ps: with ps; [ 154 + pynvim-pp 155 + pyyaml 156 + std2 157 + ]; 158 + 159 + # We need some patches so it stops complaining about not being in a venv 160 + patches = [ ./patches/chadtree/emulate-venv.patch ]; 161 + }; 162 + 152 163 ChatGPT-nvim = super.ChatGPT-nvim.overrideAttrs { 153 164 dependencies = with self; [ nui-nvim plenary-nvim telescope-nvim ]; 154 165 };
+41
pkgs/applications/editors/vim/plugins/patches/chadtree/emulate-venv.patch
··· 1 + diff --git a/chadtree/__main__.py b/chadtree/__main__.py 2 + index 83341fc..af8c9b0 100644 3 + --- a/chadtree/__main__.py 4 + +++ b/chadtree/__main__.py 5 + @@ -73,7 +73,7 @@ _EXEC_PATH = Path(executable) 6 + _EXEC_PATH = _EXEC_PATH.parent.resolve(strict=True) / _EXEC_PATH.name 7 + _REQ = REQUIREMENTS.read_text() 8 + 9 + -_IN_VENV = _RT_PY == _EXEC_PATH 10 + +_IN_VENV = True 11 + 12 + 13 + if command == "deps": 14 + @@ -129,7 +129,7 @@ elif command == "run": 15 + try: 16 + if not _IN_VENV: 17 + raise ImportError() 18 + - elif lock != _REQ: 19 + + elif False: 20 + raise ImportError() 21 + else: 22 + import pynvim_pp 23 + diff --git a/chadtree/consts.py b/chadtree/consts.py 24 + index e2d3aa0..e77a129 100644 25 + --- a/chadtree/consts.py 26 + +++ b/chadtree/consts.py 27 + @@ -1,4 +1,5 @@ 28 + from os import environ, name 29 + +from pathlib import Path 30 + 31 + from chad_types import TOP_LEVEL 32 + 33 + @@ -24,7 +25,7 @@ SETTINGS_VAR = "chadtree_settings" 34 + STORAGE 35 + """ 36 + 37 + -_VARS = TOP_LEVEL / ".vars" 38 + +_VARS = Path.home() / ".cache/chadtree/vars" 39 + RT_DIR = _VARS / "runtime" 40 + RT_PY = RT_DIR / "Scripts" / "python.exe" if IS_WIN else RT_DIR / "bin" / "python3" 41 + SESSION_DIR = _VARS / "sessions"