-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathvenv_test_harness_functions.bash
More file actions
executable file
·56 lines (41 loc) · 1.54 KB
/
venv_test_harness_functions.bash
File metadata and controls
executable file
·56 lines (41 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# Set up isolated, clean Python venv
#
# This is designed to be sourced from other bash scripts
function prepare_venv() {
# Assume the user starts in the ypkg dir
echo ">>> Updating the ypkg git repo ..."
# ensure we show the current branch
git fetch && git pull && git branch
echo ">>> Cloning or updating the eopkg git repo ..."
# assume that eopkg lives in ../eopkg
# git -C ../ clone https://github.com/getsolus/eopkg.git ||
# { git -C ../eopkg/ switch master && git -C ../eopkg/ pull; }
echo ">>> Set up a clean venv with symlink to ../eopkg/pisi in venv site-packages/ dir ..."
python3 -m venv --clear venv
source venv/bin/activate
python3 -m pip install .
python3 -m pip install ../eopkg
install_solus_prereq_pkgs
}
function install_solus_prereq_pkgs() {
# we are currently carrying a patch to iksemel that has not yet been upstreamed
sudo eopkg it iksemel
ln -srv /usr/lib/python3.12/site-packages/iksemel.cpython-312-x86_64-linux-gnu.so venv/lib/python3.12/site-packages/
}
function help() {
cat <<EOF
1. To activate the newly prepared venv, execute:
source venv/bin/activate /
source venv/bin/activate.fish /
source venv/bin/activate.zsh
... depending on which shell you use.
2. When you are done testing, execute:
deactivate
... to exit the venv.
3. To run the integration tests, execute:
./run_release_tests.sh
... this will run in a clean checkout + venv
and will deactivate the venv after
run is done.
EOF
}