2727 skips-file-extra :
2828 required : false
2929 type : string
30-
30+ extra-env-vars :
31+ required : false
32+ type : string
33+ description : ' Extra environment variables to set during the test run'
3134
3235env :
3336 PYTEST_ARGS : " --max-examples 200 -v -rxXfE --ci ${{ inputs.pytest-extra-args }} --hypothesis-disable-deadline"
@@ -38,38 +41,38 @@ jobs:
3841 strategy :
3942 matrix :
4043 python-version : ['3.9', '3.10', '3.11', '3.12']
41-
4244 steps :
43- - name : Checkout array-api-compat
44- uses : actions/checkout@v4
45- with :
46- path : array-api-compat
47- - name : Checkout array-api-tests
48- uses : actions/checkout@v4
49- with :
50- repository : data-apis/array-api-tests
51- submodules : ' true'
52- path : array-api-tests
53- - name : Set up Python ${{ matrix.python-version }}
54- uses : actions/setup-python@v5
55- with :
56- python-version : ${{ matrix.python-version }}
57- - name : Install dependencies
58- # NumPy 1.21 doesn't support Python 3.11. There doesn't seem to be a way
59- # to put this in the numpy 1.21 config file.
60- if : " ! ((matrix.python-version == '3.11' || matrix.python-version == '3.12') && inputs.package-name == 'numpy' && contains(inputs.package-version, '1.21'))"
61- run : |
62- python -m pip install --upgrade pip
63- python -m pip install '${{ inputs.package-name }} ${{ inputs.package-version }}' ${{ inputs.extra-requires }}
64- python -m pip install -r ${GITHUB_WORKSPACE}/array-api-tests/requirements.txt
65- - name : Run the array API testsuite (${{ inputs.package-name }})
66- if : " ! ((matrix.python-version == '3.11' || matrix.python-version == '3.12') && inputs.package-name == 'numpy' && contains(inputs.package-version, '1.21'))"
67- env :
68- ARRAY_API_TESTS_MODULE : array_api_compat.${{ inputs.module-name || inputs.package-name }}
69- # This enables the NEP 50 type promotion behavior (without it a lot of
70- # tests fail on bad scalar type promotion behavior)
71- NPY_PROMOTION_STATE : weak
72- run : |
73- export PYTHONPATH="${GITHUB_WORKSPACE}/array-api-compat"
74- cd ${GITHUB_WORKSPACE}/array-api-tests
75- pytest array_api_tests/ --xfails-file ${GITHUB_WORKSPACE}/array-api-compat/${{ inputs.package-name }}${{ inputs.xfails-file-extra }}-xfails.txt --skips-file ${GITHUB_WORKSPACE}/array-api-compat/${{ inputs.package-name }}${{ inputs.skips-file-extra}}-skips.txt ${PYTEST_ARGS}
45+ - name : Checkout array-api-compat
46+ uses : actions/checkout@v4
47+ with :
48+ path : array-api-compat
49+ - name : Checkout array-api-tests
50+ uses : actions/checkout@v4
51+ with :
52+ repository : data-apis/array-api-tests
53+ submodules : ' true'
54+ path : array-api-tests
55+ - name : Set up Python ${{ matrix.python-version }}
56+ uses : actions/setup-python@v5
57+ with :
58+ python-version : ${{ matrix.python-version }}
59+ - name : Install dependencies
60+ # NumPy 1.21 doesn't support Python 3.11. There doesn't seem to be a way
61+ # to put this in the numpy 1.21 config file.
62+ if : " ! ((matrix.python-version == '3.11' || matrix.python-version == '3.12') && inputs.package-name == 'numpy' && contains(inputs.package-version, '1.21'))"
63+ run : |
64+ python -m pip install --upgrade pip
65+ python -m pip install '${{ inputs.package-name }} ${{ inputs.package-version }}' ${{ inputs.extra-requires }}
66+ python -m pip install -r ${GITHUB_WORKSPACE}/array-api-tests/requirements.txt
67+ - name : Run the array API testsuite (${{ inputs.package-name }})
68+ if : " ! ((matrix.python-version == '3.11' || matrix.python-version == '3.12') && inputs.package-name == 'numpy' && contains(inputs.package-version, '1.21'))"
69+ env :
70+ ARRAY_API_TESTS_MODULE : array_api_compat.${{ inputs.module-name || inputs.package-name }}
71+ # This enables the NEP 50 type promotion behavior (without it a lot of
72+ # tests fail on bad scalar type promotion behavior)
73+ NPY_PROMOTION_STATE : weak
74+ ${{ inputs.extra-env-vars }}
75+ run : |
76+ export PYTHONPATH="${GITHUB_WORKSPACE}/array-api-compat"
77+ cd ${GITHUB_WORKSPACE}/array-api-tests
78+ pytest array_api_tests/ --xfails-file ${GITHUB_WORKSPACE}/array-api-compat/${{ inputs.package-name }}${{ inputs.xfails-file-extra }}-xfails.txt --skips-file ${GITHUB_WORKSPACE}/array-api-compat/${{ inputs.package-name }}${{ inputs.skips-file-extra}}-skips.txt ${PYTEST_ARGS}
0 commit comments