#!/bin/sh
set -eu

# Run outside the source tree so imports exercise the installed package.
test_dir=$(mktemp -d "${AUTOPKGTEST_TMP:-/tmp}/osteosarc-tests.XXXXXX")
trap 'rm -rf "$test_dir"' EXIT HUP INT TERM
cp -a tests scripts docs pyproject.toml "$test_dir/"
cd "$test_dir"
export PYTHONPATH="$test_dir"
export PYTHONDONTWRITEBYTECODE=1
export OPENVAX_DATA_CACHE="$test_dir/cache"
export OSTEOSARC_CACHE="$test_dir/cache"
export no_proxy=localhost,127.0.0.1,::1
# The wheel-building test requires the source tree and runs during the build.
python3.14 -m pytest -q tests --ignore=tests/test_package_version.py
