-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Note down useful testing script for local Python API integration tests
- Loading branch information
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
``` |
51118da
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is tangential, but have you considered using
direnv(1)
to handle setting project-specific environment variables? I find it's fairly helpful; here's what I've got in my top-level.envrc
: