From d61783b2c005608ee2d2641b7ba88e9912cf39fa Mon Sep 17 00:00:00 2001 From: Li Jie Date: Thu, 7 Nov 2024 11:08:47 +0800 Subject: [PATCH] doc: install numpy in virtualenv to run test --- doc/_readme/scripts/run.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/doc/_readme/scripts/run.sh b/doc/_readme/scripts/run.sh index f54b5257..ddb30481 100644 --- a/doc/_readme/scripts/run.sh +++ b/doc/_readme/scripts/run.sh @@ -1,7 +1,16 @@ #!/bin/bash cd ./doc/_readme/ || exit 1 llgo build -v ./... -pip3 install --user numpy + +python3 -m venv .venv +# shellcheck source=/dev/null +source .venv/bin/activate +pip3 install numpy + +PYTHONPATH="" +PYTHONPATH=$(python -c "import sys; print(':'.join(sys.path))") +export PYTHONPATH + for dir in ./*/; do if grep -q "func main()" "$dir"/*.go 2>/dev/null; then echo "Running examples in $dir"