|
16 | 16 | required: false |
17 | 17 | type: string |
18 | 18 | default: '>= 0' |
| 19 | + python-versions: |
| 20 | + required: true |
| 21 | + type: string |
| 22 | + description: JSON array of Python versions to test against. |
19 | 23 | pytest-extra-args: |
20 | 24 | required: false |
21 | 25 | type: string |
|
30 | 34 | extra-env-vars: |
31 | 35 | required: false |
32 | 36 | type: string |
33 | | - description: "Multiline string of environment variables to set for the test run." |
| 37 | + description: Multiline string of environment variables to set for the test run. |
34 | 38 |
|
35 | 39 | env: |
36 | | - PYTEST_ARGS: "--max-examples 200 -v -rxXfE --ci ${{ inputs.pytest-extra-args }} --hypothesis-disable-deadline" |
| 40 | + PYTEST_ARGS: "--max-examples 1000 -v -rxXfE ${{ inputs.pytest-extra-args }} --hypothesis-disable-deadline --durations 20" |
37 | 41 |
|
38 | 42 | jobs: |
39 | 43 | tests: |
40 | 44 | runs-on: ubuntu-latest |
41 | 45 | strategy: |
| 46 | + fail-fast: false |
42 | 47 | matrix: |
43 | | - # min version of dask we needs drops support for python 3.9 |
44 | | - python-version: ${{ inputs.package-name == 'dask' && fromJson('[''3.10'', ''3.11'', ''3.12'']') || fromJson('[''3.9'', ''3.10'', ''3.11'', ''3.12'']') }} |
| 48 | + python-version: ${{ fromJson(inputs.python-versions) }} |
45 | 49 |
|
46 | 50 | steps: |
47 | 51 | - name: Checkout array-api-compat |
48 | | - uses: actions/checkout@v4 |
| 52 | + uses: actions/checkout@v5 |
49 | 53 | with: |
50 | 54 | path: array-api-compat |
| 55 | + |
51 | 56 | - name: Checkout array-api-tests |
52 | | - uses: actions/checkout@v4 |
| 57 | + uses: actions/checkout@v5 |
53 | 58 | with: |
54 | 59 | repository: data-apis/array-api-tests |
55 | 60 | submodules: 'true' |
56 | 61 | path: array-api-tests |
| 62 | + |
57 | 63 | - name: Set up Python ${{ matrix.python-version }} |
58 | | - uses: actions/setup-python@v5 |
| 64 | + uses: actions/setup-python@v6 |
59 | 65 | with: |
60 | 66 | python-version: ${{ matrix.python-version }} |
| 67 | + |
61 | 68 | - name: Set Extra Environment Variables |
62 | 69 | # Set additional environment variables if provided |
63 | 70 | if: inputs.extra-env-vars |
64 | 71 | run: | |
65 | 72 | echo "${{ inputs.extra-env-vars }}" >> $GITHUB_ENV |
| 73 | +
|
66 | 74 | - name: Install dependencies |
67 | | - # NumPy 1.21 doesn't support Python 3.11. There doesn't seem to be a way |
68 | | - # to put this in the numpy 1.21 config file. |
69 | | - if: "! ((matrix.python-version == '3.11' || matrix.python-version == '3.12') && inputs.package-name == 'numpy' && contains(inputs.package-version, '1.21'))" |
70 | 75 | run: | |
71 | 76 | python -m pip install --upgrade pip |
72 | 77 | python -m pip install '${{ inputs.package-name }} ${{ inputs.package-version }}' ${{ inputs.extra-requires }} |
73 | 78 | python -m pip install -r ${GITHUB_WORKSPACE}/array-api-tests/requirements.txt |
| 79 | + python -m pip install pytest-xdist |
| 80 | +
|
| 81 | + - name: Dump pip environment |
| 82 | + run: pip freeze |
| 83 | + |
74 | 84 | - name: Run the array API testsuite (${{ inputs.package-name }}) |
75 | | - if: "! ((matrix.python-version == '3.11' || matrix.python-version == '3.12') && inputs.package-name == 'numpy' && contains(inputs.package-version, '1.21'))" |
76 | 85 | env: |
77 | 86 | ARRAY_API_TESTS_MODULE: array_api_compat.${{ inputs.module-name || inputs.package-name }} |
78 | | - ARRAY_API_TESTS_VERSION: 2023.12 |
| 87 | + ARRAY_API_TESTS_VERSION: 2024.12 |
79 | 88 | # This enables the NEP 50 type promotion behavior (without it a lot of |
80 | 89 | # tests fail on bad scalar type promotion behavior) |
81 | 90 | NPY_PROMOTION_STATE: weak |
|
0 commit comments