Repository navigation
85 lines (76 loc) · 3.02 KB
/
Copy pathtests.yml
File metadata and controls
85 lines (76 loc) · 3.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: Tests
on: [push, pull_request]
jobs:
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- numpy-version: '1.22'
python-version: '3.10'
- numpy-version: '1.26'
python-version: '3.10'
- numpy-version: '1.26'
python-version: '3.12'
- numpy-version: 'latest'
python-version: '3.10'
- numpy-version: 'latest'
python-version: '3.13'
- numpy-version: 'latest'
python-version: '3.14'
- numpy-version: 'dev'
python-version: '3.11'
- numpy-version: 'dev'
python-version: '3.13'
- numpy-version: 'dev'
python-version: '3.14'
steps:
- uses: actions/checkout@v7.0.1
- uses: actions/setup-python@v7.0.0
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pytest
# Don't `pip install .[dev]` as it would pull in the whole torch cuda stack
python -m pip install array-api-strict
python -m pip install torch --index-url https://download.pytorch.org/whl/cpu
if [ "${{ matrix.numpy-version }}" == "dev" ]; then
python -m pip install numpy --pre --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple
python -m pip install dask[array] jax[cpu]
python -m pip install --index-url https://software.repos.intel.com/python/pypi dpnp
if [ "${{ matrix.python-version }}" != "3.14" ]; then
python -m pip install sparse ndonnx
fi
elif [ "${{ matrix.numpy-version }}" == "1.22" ]; then
python -m pip install 'numpy==1.22.*'
elif [ "${{ matrix.numpy-version }}" == "1.26" ]; then
python -m pip install 'numpy==1.26.*'
else
python -m pip install numpy
python -m pip install dask[array] jax[cpu]
python -m pip install --index-url https://software.repos.intel.com/python/pypi dpnp
if [ "${{ matrix.python-version }}" != "3.14" ]; then
python -m pip install sparse ndonnx
fi
fi
# mparray requires Python >=3.11 and NumPy >=2.
if [[ "${{ matrix.python-version }}" =~ ^3\.1[1-4]$ &&
"${{ matrix.numpy-version }}" =~ ^(latest|dev)$ ]]; then
python -m pip install mparray
fi
- name: Set environment variables
run: echo "OCL_ICD_FILENAMES=$LD_LIBRARY_PATH/libintelocl.so" >> "$GITHUB_ENV"
- name: Dump pip environment
run: pip freeze
- name: Test it installs
run: python -m pip install .
- name: Run Tests
run: pytest -v
- name: Run vendoring tests
run: |
rm -rf vendor_tests/array_api_compat
cp -r src/array_api_compat vendor_tests/
pytest -v vendor_tests