doc: install numpy in virtualenv to run test

This commit is contained in:
Li Jie
2024-11-07 11:08:47 +08:00
parent 65c1e1b9e5
commit d61783b2c0

View File

@@ -1,7 +1,16 @@
#!/bin/bash #!/bin/bash
cd ./doc/_readme/ || exit 1 cd ./doc/_readme/ || exit 1
llgo build -v ./... 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 for dir in ./*/; do
if grep -q "func main()" "$dir"/*.go 2>/dev/null; then if grep -q "func main()" "$dir"/*.go 2>/dev/null; then
echo "Running examples in $dir" echo "Running examples in $dir"