MAINT: Try fixing mypy again #6
This file contains 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: Array API | |
on: | |
push: | |
pull_request: | |
branches: | |
- main | |
- maintenance/** | |
permissions: | |
contents: read # to fetch code (actions/checkout) | |
env: | |
CCACHE_DIR: "${{ github.workspace }}/.ccache" | |
INSTALLDIR: "build-install" | |
XP_TESTS: >- | |
-t scipy.cluster | |
-t scipy.constants | |
-t scipy.fft | |
-t scipy.special.tests.test_logsumexp | |
-t scipy.special.tests.test_support_alternative_backends | |
-t scipy._lib.tests.test_array_api | |
-t scipy._lib.tests.test__util | |
-t scipy.differentiate.tests.test_differentiate | |
-t scipy.integrate.tests.test_tanhsinh | |
-t scipy.optimize.tests.test_chandrupatla | |
-t scipy.stats | |
-t scipy.ndimage | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
get_commit_message: | |
name: Get commit message | |
uses: ./.github/workflows/commit_message.yml | |
pytorch_cpu: | |
name: Linux PyTorch/JAX/xp-strict CPU | |
needs: get_commit_message | |
if: > | |
needs.get_commit_message.outputs.message == 1 | |
&& (github.repository == 'HaoZeke/scipy' || github.repository == '') | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
python-version: ['3.11'] | |
maintenance-branch: | |
- ${{ contains(github.ref, 'maintenance/') || contains(github.base_ref, 'maintenance/') }} | |
exclude: | |
- maintenance-branch: true | |
steps: | |
- uses: actions/[email protected] | |
with: | |
submodules: recursive | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pip' # not using a path to also cache pytorch | |
- name: Install Ubuntu dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libopenblas-dev libatlas-base-dev liblapack-dev gfortran libgmp-dev libmpfr-dev libsuitesparse-dev ccache libmpc-dev | |
- name: Install Python packages | |
run: | | |
python -m pip install numpy cython pytest pytest-xdist pytest-timeout pybind11 mpmath gmpy2 pythran ninja meson click rich-click doit pydevtool pooch hypothesis array-api-strict | |
- name: Install PyTorch CPU | |
run: | | |
python -m pip install torch --index-url https://download.pytorch.org/whl/cpu | |
- name: Install JAX | |
run: | | |
python -m pip install "jax[cpu]" | |
- name: Prepare compiler cache | |
id: prep-ccache | |
shell: bash | |
run: | | |
mkdir -p "${CCACHE_DIR}" | |
echo "dir=$CCACHE_DIR" >> $GITHUB_OUTPUT | |
NOW=$(date -u +"%F-%T") | |
echo "timestamp=${NOW}" >> $GITHUB_OUTPUT | |
- name: Setup compiler cache | |
uses: actions/cache@v4 | |
id: cache-ccache | |
with: | |
path: ${{ steps.prep-ccache.outputs.dir }} | |
key: ${{ github.workflow }}-${{ matrix.python-version }}-ccache-linux-${{ steps.prep-ccache.outputs.timestamp }} | |
restore-keys: | | |
${{ github.workflow }}-${{ matrix.python-version }}-ccache-linux- | |
- name: Setup build and install scipy | |
run: | | |
python dev.py build | |
- name: Test SciPy | |
run: | | |
export OMP_NUM_THREADS=2 | |
# expand as more modules are supported by adding to `XP_TESTS` above | |
python dev.py --no-build test -b all $XP_TESTS -- --durations 3 --timeout=60 |