File: test-dockerfile.sh

package info (click to toggle)
python-maturin 1.9.4-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,540 kB
  • sloc: python: 656; javascript: 93; sh: 55; makefile: 10
file content (25 lines) | stat: -rwxr-xr-x 994 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/env bash
# Builds all 6 test crates using the docker container,
# installs the wheel and checks that the installed package is functional

set -e

rm -rf venv-docker
python3.11 -m venv venv-docker
venv-docker/bin/pip install -U pip cffi

# FIXME: Can we run the tests without activate? Currently hello-world fails because then the binary is not in PATH
source venv-docker/bin/activate

for test_crate in hello-world cffi-pure cffi-mixed pyo3-pure pyo3-mixed pyo3-mixed-submodule pyo3-mixed-implicit
do
  echo "Testing $test_crate"
  docker run -e RUST_BACKTRACE=1 --rm -v "$(pwd):/io" -w /io/test-crates/$test_crate maturin build -i python3.11
  # --only-binary=:all: stops pip from picking a local already compiled sdist
  venv-docker/bin/pip install $test_crate --only-binary=:all: --find-links test-crates/$test_crate/target/wheels/
  if [[ $(venv-docker/bin/python test-crates/$test_crate/check_installed/check_installed.py) != 'SUCCESS' ]]; then
    exit 1
  fi
done

deactivate