Skip to content

Commit 5adc990

Browse files
committed
Use pytest for testing
1 parent dff5653 commit 5adc990

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

.github/workflows/build.yml

+8-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,15 @@ permissions:
66
contents: read
77

88
env:
9-
CIBW_BEFORE_BUILD: pip install setuptools oldest-supported-numpy
9+
CIBW_BEFORE_BUILD: pip install setuptools oldest-supported-numpy pytest
10+
CIBW_ENVIRONMENT: >
11+
IS_FREETHREADED=$(python -c "import sysconfig;print(sysconfig.get_config_var('Py_GIL_DISABLED'))")
12+
PYTEST_RUN_PARALLEL=$([ "$IS_FREETHREADED" == "1" ] && echo "pytest-run-parallel" || echo "")
13+
PARALLEL_THREADS=$([ "$IS_FREETHREADED" == "1" ] && echo "--parallel-threads=4" || echo "")
14+
CIBW_BEFORE_BUILD_LINUX: >
15+
pip install setuptools oldest-supported-numpy pytest $PYTEST_RUN_PARALLEL
1016
CIBW_BUILD_VERBOSITY: 1
11-
CIBW_TEST_COMMAND: python -c "import sys, numexpr; sys.exit(0 if numexpr.test().wasSuccessful() else 1)"
17+
CIBW_TEST_COMMAND: pytest $PARALLEL_THREADS numexpr/tests
1218
CIBW_TEST_SKIP: "*macosx*arm64*"
1319
# Building for musllinux and aarch64 takes way too much time.
1420
# Moreover, NumPy is not providing musllinux for x86_64 either, so it's not worth it.

0 commit comments

Comments
 (0)