Skip to content

Commit afda301

Browse files
authored
Merge pull request #185 from python-discord/jb3/refactor-eval-deps
Refactor how we process eval dependencies
2 parents 0292661 + 4251c08 commit afda301

File tree

2 files changed

+40
-35
lines changed

2 files changed

+40
-35
lines changed

deployment.yaml

Lines changed: 16 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,22 @@ spec:
1212
labels:
1313
app: snekbox
1414
spec:
15+
initContainers:
16+
- name: deps-install
17+
image: ghcr.io/python-discord/snekbox:latest
18+
imagePullPolicy: Always
19+
volumeMounts:
20+
- name: snekbox-user-base-volume
21+
mountPath: /snekbox/user_base
22+
env:
23+
- name: PYTHONUSERBASE
24+
value: /snekbox/user_base
25+
command:
26+
- "/bin/sh"
27+
- "-c"
28+
- >-
29+
find /lang/python -mindepth 1 -maxdepth 1 -type d -exec
30+
{}/bin/python -m pip install --user -U -r requirements/eval-deps.pip \;
1531
containers:
1632
- name: snekbox
1733
image: ghcr.io/python-discord/snekbox:latest
@@ -23,41 +39,6 @@ spec:
2339
volumeMounts:
2440
- name: snekbox-user-base-volume
2541
mountPath: /snekbox/user_base
26-
lifecycle:
27-
postStart:
28-
exec:
29-
command:
30-
- "/bin/sh"
31-
- "-c"
32-
- >-
33-
find /lang/python -mindepth 1 -maxdepth 1 -type d -exec
34-
sh -c 'PYTHONUSERBASE=/snekbox/user_base &&
35-
{}/bin/python -m pip install --user -U
36-
anyio[trio]~=3.6
37-
arrow~=1.2
38-
attrs~=22.2
39-
beautifulsoup4~=4.11
40-
einspect~=0.5
41-
fishhook~=0.2
42-
forbiddenfruit~=0.1
43-
fuzzywuzzy~=0.18
44-
lark~=1.1
45-
"matplotlib~=3.6 ; python_version == \'3.11\'"
46-
more-itertools~=9.0
47-
networkx~=3.0
48-
"numpy~=1.24 ; python_version == \'3.11\'"
49-
"numpy==1.26.0b1 ; python_version == \'3.12\'"
50-
"pandas~=1.5 ; python_version == \'3.11\'"
51-
"pendulum~=2.1 ; python_version == \'3.11\'"
52-
python-dateutil~=2.8
53-
pyyaml~=6.0
54-
scipy~=1.10
55-
sympy~=1.11
56-
toml~=0.10
57-
typing-extensions~=4.4
58-
tzdata~=2022.7
59-
"yarl~=1.8 ; python_version == \'3.11\'"
60-
' \;
6142
volumes:
6243
- name: snekbox-user-base-volume
6344
hostPath:

requirements/eval-deps.pip

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
anyio[trio]~=3.6
2+
arrow~=1.2
3+
attrs~=22.2
4+
beautifulsoup4~=4.11
5+
einspect~=0.5
6+
fishhook~=0.2
7+
forbiddenfruit~=0.1
8+
fuzzywuzzy~=0.18
9+
lark~=1.1
10+
matplotlib~=3.6 ; python_version == '3.11'
11+
more-itertools~=9.0
12+
networkx~=3.0
13+
numpy~=1.24 ; python_version == '3.11'
14+
numpy==1.26.0b1 ; python_version == '3.12'
15+
pandas~=1.5 ; python_version == '3.11'
16+
pendulum~=2.1 ; python_version == '3.11'
17+
python-dateutil~=2.8
18+
pyyaml~=6.0
19+
scipy~=1.10
20+
sympy~=1.11
21+
toml~=0.10
22+
typing-extensions~=4.4
23+
tzdata~=2022.7
24+
yarl~=1.8 ; python_version == '3.11'

0 commit comments

Comments
 (0)