Skip to content

Commit 1d66ff7

Browse files
committed
Merge branch 'main' into no-dependencies
2 parents 93b8a53 + 311d0aa commit 1d66ff7

23 files changed

+538
-322
lines changed

Diff for: .github/workflows/array-api-tests.yml

+5-7
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
runs-on: ubuntu-latest
3838
strategy:
3939
matrix:
40-
python-version: ['3.8', '3.9', '3.10', '3.11']
40+
python-version: ['3.9', '3.10', '3.11', '3.12']
4141

4242
steps:
4343
- name: Checkout array-api-compat
@@ -55,17 +55,15 @@ jobs:
5555
with:
5656
python-version: ${{ matrix.python-version }}
5757
- name: Install dependencies
58-
# NumPy 1.21 doesn't support Python 3.11. NumPy 2.0 doesn't support
59-
# Python 3.8. There doesn't seem to be a way to put this in the numpy
60-
# 1.21 config file.
61-
if: "! ((matrix.python-version == '3.11' && inputs.package-name == 'numpy' && contains(inputs.package-version, '1.21')) || (matrix.python-version == '3.8' && inputs.package-name == 'numpy' && contains(inputs.xfails-file-extra, 'dev')))"
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'))"
6261
run: |
6362
python -m pip install --upgrade pip
6463
python -m pip install '${{ inputs.package-name }} ${{ inputs.package-version }}' ${{ inputs.extra-requires }}
6564
python -m pip install -r ${GITHUB_WORKSPACE}/array-api-tests/requirements.txt
66-
python -m pip install hypothesis==6.97.1
6765
- name: Run the array API testsuite (${{ inputs.package-name }})
68-
if: "! ((matrix.python-version == '3.11' && inputs.package-name == 'numpy' && contains(inputs.package-version, '1.21')) || (matrix.python-version == '3.8' && inputs.package-name == 'numpy' && contains(inputs.xfails-file-extra, 'dev')))"
66+
if: "! ((matrix.python-version == '3.11' || matrix.python-version == '3.12') && inputs.package-name == 'numpy' && contains(inputs.package-version, '1.21'))"
6967
env:
7068
ARRAY_API_TESTS_MODULE: array_api_compat.${{ inputs.module-name || inputs.package-name }}
7169
# This enables the NEP 50 type promotion behavior (without it a lot of

Diff for: .github/workflows/docs-build.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Docs Build
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
docs-build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
- uses: actions/setup-python@v5
11+
- name: Install Dependencies
12+
run: |
13+
python -m pip install -r docs/requirements.txt
14+
- name: Build Docs
15+
run: |
16+
cd docs
17+
make html
18+
- name: Upload Artifact
19+
uses: actions/upload-artifact@v4
20+
with:
21+
name: docs-build
22+
path: docs/_build/html

Diff for: .github/workflows/docs.yml renamed to .github/workflows/docs-deploy.yml

+16-17
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,29 @@
1-
name: Docs
2-
on: [push, pull_request]
1+
name: Docs Deploy
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
38
jobs:
4-
docs:
9+
docs-deploy:
510
runs-on: ubuntu-latest
6-
strategy:
7-
fail-fast: false
811
environment:
9-
name: docs-build-and-deploy
12+
name: docs-deploy
1013
steps:
11-
- uses: actions/checkout@v2
12-
- uses: actions/setup-python@v2
13-
- name: Install Dependencies
14-
run: |
15-
python -m pip install -r docs/requirements.txt
16-
17-
- name: Build Docs
18-
run: |
19-
cd docs
20-
make html
14+
- uses: actions/checkout@v4
15+
- name: Download Artifact
16+
uses: dawidd6/action-download-artifact@v2
17+
with:
18+
workflow: docs-build.yml
19+
name: docs-build
20+
path: docs/_build/html
2121

2222
# Note, the gh-pages deployment requires setting up a SSH deploy key.
2323
# See
2424
# https://github.com/JamesIves/github-pages-deploy-action/tree/dev#using-an-ssh-deploy-key-
2525
- name: Deploy
2626
uses: JamesIves/github-pages-deploy-action@v4
27-
if: ${{ github.ref == 'refs/heads/main' }}
2827
with:
2928
folder: docs/_build/html
3029
ssh-key: ${{ secrets.DEPLOY_KEY }}

Diff for: .github/workflows/publish-package.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666

6767
publish:
6868
name: Publish Python distribution to (Test)PyPI
69-
if: github.event_name != 'pull_request' && github.repository == 'data-apis/array-api-compat'
69+
if: github.event_name != 'pull_request' && github.repository == 'data-apis/array-api-compat' && github.ref_type == 'tag'
7070
needs: build
7171
runs-on: ubuntu-latest
7272
# Mandatory for publishing with a trusted publisher
@@ -94,19 +94,19 @@ jobs:
9494
if: >-
9595
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags'))
9696
|| (github.event_name == 'workflow_dispatch' && github.event.inputs.publish == 'true')
97-
uses: pypa/[email protected].12
97+
uses: pypa/[email protected].14
9898
with:
9999
repository-url: https://test.pypi.org/legacy/
100100
print-hash: true
101101

102102
- name: Create GitHub Release from a Tag
103-
uses: softprops/action-gh-release@v1
103+
uses: softprops/action-gh-release@v2
104104
if: startsWith(github.ref, 'refs/tags/')
105105
with:
106106
files: dist/*
107107

108108
- name: Publish distribution 📦 to PyPI
109109
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
110-
uses: pypa/[email protected].12
110+
uses: pypa/[email protected].14
111111
with:
112112
print-hash: true

Diff for: .github/workflows/tests.yml

+20-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@ jobs:
55
runs-on: ubuntu-latest
66
strategy:
77
matrix:
8-
python-version: ['3.8', '3.9', '3.10', '3.11']
8+
python-version: ['3.9', '3.10', '3.11', '3.12']
9+
numpy-version: ['1.21', '1.26', 'dev']
10+
exclude:
11+
- python-version: '3.11'
12+
numpy-version: '1.21'
13+
- python-version: '3.12'
14+
numpy-version: '1.21'
915
fail-fast: true
1016
steps:
1117
- uses: actions/checkout@v4
@@ -15,11 +21,21 @@ jobs:
1521
- name: Install Dependencies
1622
run: |
1723
python -m pip install --upgrade pip
18-
python -m pip install -r requirements-dev.txt
24+
if [ "${{ matrix.numpy-version }}" == "dev" ]; then
25+
PIP_EXTRA='numpy --pre --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple'
26+
elif [ "${{ matrix.numpy-version }}" == "1.21" ]; then
27+
PIP_EXTRA='numpy==1.21.*'
28+
else
29+
PIP_EXTRA='numpy==1.26.*'
30+
fi
31+
python -m pip install -r requirements-dev.txt $PIP_EXTRA
1932
2033
- name: Run Tests
2134
run: |
22-
pytest
35+
if [[ "${{ matrix.numpy-version }}" == "1.21" || "${{ matrix.numpy-version }}" == "dev" ]]; then
36+
PYTEST_EXTRA=(-k "numpy and not jax and not torch and not dask")
37+
fi
38+
pytest -v "${PYTEST_EXTRA[@]}"
2339
2440
# Make sure it installs
25-
python setup.py install
41+
python -m pip install .

Diff for: CHANGELOG.md

-163
This file was deleted.

Diff for: CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
docs/changelog.md

Diff for: array_api_compat/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717
this implementation for the default when working with NumPy arrays.
1818
1919
"""
20-
__version__ = '1.5'
20+
__version__ = '1.5.1'
2121

2222
from .common import * # noqa: F401, F403

0 commit comments

Comments
 (0)