Improve DLPack support for non CPU devices #699
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Tests | |
| on: [push, pull_request] | |
| jobs: | |
| tests: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| 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' | |
| - python-version: '3.13' | |
| numpy-version: '1.26' | |
| - python-version: '3.14' | |
| numpy-version: '1.26' | |
| include: | |
| # exercise the DLPack interop tests, which need another array library | |
| - python-version: '3.13' | |
| numpy-version: 'latest' | |
| torch: true | |
| fail-fast: false | |
| 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 | |
| if [[ "${{ matrix.numpy-version }}" == "dev" ]]; then | |
| python -m pip install --pre --extra-index https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy; | |
| elif [[ "${{ matrix.numpy-version }}" == "latest" ]]; then | |
| python -m pip install numpy | |
| else | |
| python -m pip install 'numpy=='${{ matrix.numpy-version }} | |
| fi | |
| python -m pip install pytest hypothesis | |
| python -c'import numpy as np; print(f"{np.__version__ = }")' | |
| - name: Install PyTorch | |
| if: matrix.torch | |
| run: | | |
| python -m pip install torch --index-url https://download.pytorch.org/whl/cpu | |
| python -c'import torch; print(f"{torch.__version__ = }")' | |
| - name: Run Tests | |
| run: | | |
| pytest | |
| # Make sure it installs | |
| pip install . |