tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
vimPlugins.chadtree: add python dependencies
Gaetan Lepage
2 years ago
fde35735
aa33c85d
+52
2 changed files
expand all
collapse all
unified
split
pkgs
applications
editors
vim
plugins
overrides.nix
patches
chadtree
emulate-venv.patch
+11
pkgs/applications/editors/vim/plugins/overrides.nix
···
149
149
};
150
150
};
151
151
152
152
+
chadtree = super.chadtree.overrideAttrs {
153
153
+
passthru.python3Dependencies = ps: with ps; [
154
154
+
pynvim-pp
155
155
+
pyyaml
156
156
+
std2
157
157
+
];
158
158
+
159
159
+
# We need some patches so it stops complaining about not being in a venv
160
160
+
patches = [ ./patches/chadtree/emulate-venv.patch ];
161
161
+
};
162
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
1
+
diff --git a/chadtree/__main__.py b/chadtree/__main__.py
2
2
+
index 83341fc..af8c9b0 100644
3
3
+
--- a/chadtree/__main__.py
4
4
+
+++ b/chadtree/__main__.py
5
5
+
@@ -73,7 +73,7 @@ _EXEC_PATH = Path(executable)
6
6
+
_EXEC_PATH = _EXEC_PATH.parent.resolve(strict=True) / _EXEC_PATH.name
7
7
+
_REQ = REQUIREMENTS.read_text()
8
8
+
9
9
+
-_IN_VENV = _RT_PY == _EXEC_PATH
10
10
+
+_IN_VENV = True
11
11
+
12
12
+
13
13
+
if command == "deps":
14
14
+
@@ -129,7 +129,7 @@ elif command == "run":
15
15
+
try:
16
16
+
if not _IN_VENV:
17
17
+
raise ImportError()
18
18
+
- elif lock != _REQ:
19
19
+
+ elif False:
20
20
+
raise ImportError()
21
21
+
else:
22
22
+
import pynvim_pp
23
23
+
diff --git a/chadtree/consts.py b/chadtree/consts.py
24
24
+
index e2d3aa0..e77a129 100644
25
25
+
--- a/chadtree/consts.py
26
26
+
+++ b/chadtree/consts.py
27
27
+
@@ -1,4 +1,5 @@
28
28
+
from os import environ, name
29
29
+
+from pathlib import Path
30
30
+
31
31
+
from chad_types import TOP_LEVEL
32
32
+
33
33
+
@@ -24,7 +25,7 @@ SETTINGS_VAR = "chadtree_settings"
34
34
+
STORAGE
35
35
+
"""
36
36
+
37
37
+
-_VARS = TOP_LEVEL / ".vars"
38
38
+
+_VARS = Path.home() / ".cache/chadtree/vars"
39
39
+
RT_DIR = _VARS / "runtime"
40
40
+
RT_PY = RT_DIR / "Scripts" / "python.exe" if IS_WIN else RT_DIR / "bin" / "python3"
41
41
+
SESSION_DIR = _VARS / "sessions"