diff --git a/.github/workflows/array-api-tests.yml b/.github/workflows/array-api-tests.yml index 7241d4b..6e3d6ec 100644 --- a/.github/workflows/array-api-tests.yml +++ b/.github/workflows/array-api-tests.yml @@ -8,16 +8,20 @@ env: jobs: array-api-tests: - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} + defaults: + run: + shell: bash strategy: matrix: + os: [ubuntu-latest, macos-latest, windows-latest] python-version: ['3.10', '3.13', '3.14'] numpy-version: ['1.26', 'latest', 'dev'] exclude: - python-version: '3.10' numpy-version: 'latest' - python-version: '3.10' - numpy-version: 'dev' + numpy-version: 'dev' - python-version: '3.13' numpy-version: '1.26' - python-version: '3.14' @@ -55,9 +59,19 @@ jobs: env: ARRAY_API_TESTS_MODULE: array_api_strict run: | + SKIPS_FILES="--skips-file ${GITHUB_WORKSPACE}/array-api-strict/array-api-tests-xfails.txt" + case "${{ matrix.os }}" in + macos-latest) + SKIPS_FILES="${SKIPS_FILES} --skips-file ${GITHUB_WORKSPACE}/array-api-strict/array-api-tests-macos-xfails.txt" + ;; + windows-latest) + SKIPS_FILES="${SKIPS_FILES} --skips-file ${GITHUB_WORKSPACE}/array-api-strict/array-api-tests-windows-xfails.txt" + ;; + esac + # Parameterizing this in the CI matrix is wasteful. Just do a loop here. for ARRAY_API_STRICT_API_VERSION in ${API_VERSIONS}; do export ARRAY_API_STRICT_API_VERSION cd ${GITHUB_WORKSPACE}/array-api-tests - pytest array_api_tests/ --skips-file ${GITHUB_WORKSPACE}/array-api-strict/array-api-tests-xfails.txt ${PYTEST_ARGS} + pytest array_api_tests/ ${SKIPS_FILES} ${PYTEST_ARGS} done diff --git a/array-api-tests-macos-xfails.txt b/array-api-tests-macos-xfails.txt new file mode 100644 index 0000000..2ad2411 --- /dev/null +++ b/array-api-tests-macos-xfails.txt @@ -0,0 +1,12 @@ +# Additional failures on MacOS: all tests listed in `array-api-tests-xfails.txt` fail everywhere, plus those listed here. + +# https://github.com/numpy/numpy/issues/32234 +array_api_tests/test_special_cases.py::test_unary[atanh(real(x_i) is +0 and imag(x_i) is NaN) -> +0 + NaN j] +array_api_tests/test_special_cases.py::test_unary[tanh(real(x_i) is +0 and imag(x_i) is +infinity) -> +0 + NaN j] +array_api_tests/test_special_cases.py::test_unary[tanh(real(x_i) is +0 and imag(x_i) is NaN) -> +0 + NaN j] +array_api_tests/test_operators_and_elementwise_functions.py::test_sqrt +array_api_tests/test_special_cases.py::test_unary[atanh(real(x_i) is 1 and imag(x_i) is +0) -> +infinity + 0j] +array_api_tests/test_special_cases.py::test_unary[atanh(isfinite(real(x_i)) and real(x_i) != 0 and imag(x_i) is NaN) -> NaN + NaN j] +array_api_tests/test_special_cases.py::test_unary[atanh(real(x_i) is +infinity and imag(x_i) is NaN) -> +0 + NaN j] +array_api_tests/test_special_cases.py::test_unary[atanh(real(x_i) is NaN and imag(x_i) is +infinity) -> \xb10 + \u03c0j/2] +array_api_tests/test_special_cases.py::test_unary[atanh(real(x_i) is NaN and isfinite(imag(x_i))) -> NaN + NaN j] \ No newline at end of file diff --git a/array-api-tests-windows-xfails.txt b/array-api-tests-windows-xfails.txt new file mode 100644 index 0000000..899a6ca --- /dev/null +++ b/array-api-tests-windows-xfails.txt @@ -0,0 +1,10 @@ +# Additional failures on Windows: all tests listed in `array-api-tests-xfails.txt` fail everywhere, plus those listed here. + +# https://github.com/numpy/numpy/issues/32234 +array_api_tests/test_special_cases.py::test_unary[atanh(real(x_i) is +0 and imag(x_i) is NaN) -> +0 + NaN j] +array_api_tests/test_special_cases.py::test_unary[tanh(real(x_i) is +0 and imag(x_i) is +infinity) -> +0 + NaN j] +array_api_tests/test_special_cases.py::test_unary[tanh(real(x_i) is +0 and imag(x_i) is NaN) -> +0 + NaN j] + +# https://github.com/numpy/numpy/pull/24224: Fixed in NumPy 2.0 +array_api_tests/test_creation_functions.py::test_arange +array_api_tests/test_creation_functions.py::test_full \ No newline at end of file