Debian Codegraph @

test-dockerfile.sh

raw
1 #!/usr/bin/env bash
2 # Builds all 6 test crates using the docker container,
3 # installs the wheel and checks that the installed package is functional
4
5 set -e
6
7 rm -rf venv-docker
8 python3.11 -m venv venv-docker
9 venv-docker/bin/pip install -U pip cffi
10
11 # FIXME: Can we run the tests without activate? Currently hello-world fails because then the binary is not in PATH
12 source venv-docker/bin/activate
13
14 for test_crate in hello-world cffi-pure cffi-mixed pyo3-pure pyo3-mixed pyo3-mixed-submodule pyo3-mixed-implicit
15 do
16 echo "Testing $test_crate"
17 docker run -e RUST_BACKTRACE=1 --rm -v "$(pwd):/io" -w /io/test-crates/$test_crate maturin build -i python3.11
18 # --only-binary=:all: stops pip from picking a local already compiled sdist
19 venv-docker/bin/pip install $test_crate --only-binary=:all: --find-links test-crates/$test_crate/target/wheels/
20 if [[ $(venv-docker/bin/python test-crates/$test_crate/check_installed/check_installed.py) != 'SUCCESS' ]]; then
21 exit 1
22 fi
23 done
24
25 deactivate