-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathsetup-test-env.sh
More file actions
executable file
·24 lines (21 loc) · 1.02 KB
/
setup-test-env.sh
File metadata and controls
executable file
·24 lines (21 loc) · 1.02 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
#!/bin/bash
set -euo pipefail
# This script wouldn't be required if models and resources move into a proper 'lightkube_models' package and are not
# symlinked into the source tree
if [ -d "../lightkube-models" ]; then
echo "Found 'lightkube-models' locally. Will use that as source root."
SOURCE_DIR=$(realpath "../lightkube-models/src")
else
echo "Did not find 'lightkube-models' locally. Will use the venv's site packages folder as source root."
SOURCE_DIR=$(uv run --no-project python -c 'import site; print(site.getsitepackages()[0])')
if ! uv pip show lightkube-models > /dev/null; then
echo "Package 'lightkube-models' isn't installed, will install upstream version."
uv pip install lightkube-models
else
echo "Package 'lightkube-models' is installed."
fi
fi
echo "Source dir of 'lightkube-models' is ${SOURCE_DIR}, will link that into the source tree."
rm -f src/lightkube/models src/lightkube/resources
ln -s $SOURCE_DIR/lightkube/models src/lightkube
ln -s $SOURCE_DIR/lightkube/resources src/lightkube