From a3ccfb1f3643d1695c51cb4f6f956df69fe9bb0e Mon Sep 17 00:00:00 2001 From: Bart Feenstra Date: Sat, 4 May 2024 23:00:08 +0100 Subject: [PATCH] Improve test coverage of the Setuptools build script by installing the Wheel and calling the betty command (#1456) --- bin/test-build-setuptools | 15 +++++++++++++++ pyproject.toml | 1 + 2 files changed, 16 insertions(+) diff --git a/bin/test-build-setuptools b/bin/test-build-setuptools index 04e833181..7caf57fea 100755 --- a/bin/test-build-setuptools +++ b/bin/test-build-setuptools @@ -14,3 +14,18 @@ if [ $build_exit_code -ne 0 ]; then echo "$build_output" exit $build_exit_code fi +wheel_path="$(pwd)/dist/betty-0.0.0-py3-none-any.whl" +( + working_directory_path="$(mktemp -d)" + trap 'rm -r "$working_directory_path"' EXIT + cd "$working_directory_path" + python -m virtualenv venv + # shellcheck disable=SC1091 + if python -c 'import sys; exit(0 if sys.platform == "win32" else 1)'; then + . ./venv/Scripts/activate + else + . ./venv/bin/activate + fi + pip install "$wheel_path" + betty --version +) diff --git a/pyproject.toml b/pyproject.toml index 3e4648c1f..b20efea6c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -127,6 +127,7 @@ test = [ 'types-pyyaml ~= 6.0, >= 6.0.6', 'types-requests ~= 2.29, >= 2.29.0.0', 'types-setuptools ~= 69.0', + 'virtualenv ~= 20.26', 'betty[pyinstaller]', 'betty[setuptools]', ]