From 51118da2c004322b5789d1f5621c27995f1f66d1 Mon Sep 17 00:00:00 2001 From: Liam Bigelow <40188355+bglw@users.noreply.github.com> Date: Mon, 30 Sep 2024 11:56:03 +1300 Subject: [PATCH] Note down useful testing script for local Python API integration tests --- wrappers/python/src/tests/README.md | 37 +++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 wrappers/python/src/tests/README.md diff --git a/wrappers/python/src/tests/README.md b/wrappers/python/src/tests/README.md new file mode 100644 index 00000000..d4e08ae3 --- /dev/null +++ b/wrappers/python/src/tests/README.md @@ -0,0 +1,37 @@ +Script to run tests from the repo root on an M* macOS: + +```py +bin="$PWD/target/release/pagefind" +ext="$PWD/target/release/pagefind_extended" + +cd wrappers/python + +# set up the python virtual environment +poetry install --no-root # for dev dependencies +export VIRTUAL_ENV="${PWD}/.venv" +export PATH="$VIRTUAL_ENV/bin:$PATH" + +# build and install the binary-only wheels + +python3 -m scripts.build.binary_only_wheel \ + --llvm-triple="aarch64-apple-darwin" \ + --bin-path=$bin \ + --version=1.1.0 + +python3 -m scripts.build.binary_only_wheel \ + --llvm-triple="aarch64-apple-darwin" \ + --bin-path=$ext \ + --version=1.1.0 + +python3 -m scripts.build.api_package + +poetry build # build the source-only distribution for the python API +# install all the wheels +pip install ./dist/*.whl --force-reinstall +pip show --verbose pagefind +pip show --verbose pagefind_bin +pip show --verbose pagefind_bin_extended +python3 --version + +LOG_LEVEL="DEBUG" python3 ./src/tests/integration.py 2>&1 | tee /tmp/integration_test.log +```