Skip to content

Commit

Permalink
Merge branch 'main' into no-dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
asmeurer committed Mar 27, 2024
2 parents 93b8a53 + 311d0aa commit 1d66ff7
Show file tree
Hide file tree
Showing 23 changed files with 538 additions and 322 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/array-api-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
python-version: ['3.9', '3.10', '3.11', '3.12']

steps:
- name: Checkout array-api-compat
Expand All @@ -55,17 +55,15 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
# NumPy 1.21 doesn't support Python 3.11. NumPy 2.0 doesn't support
# Python 3.8. There doesn't seem to be a way to put this in the numpy
# 1.21 config file.
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')))"
# NumPy 1.21 doesn't support Python 3.11. There doesn't seem to be a way
# to put this in the numpy 1.21 config file.
if: "! ((matrix.python-version == '3.11' || matrix.python-version == '3.12') && inputs.package-name == 'numpy' && contains(inputs.package-version, '1.21'))"
run: |
python -m pip install --upgrade pip
python -m pip install '${{ inputs.package-name }} ${{ inputs.package-version }}' ${{ inputs.extra-requires }}
python -m pip install -r ${GITHUB_WORKSPACE}/array-api-tests/requirements.txt
python -m pip install hypothesis==6.97.1
- name: Run the array API testsuite (${{ inputs.package-name }})
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')))"
if: "! ((matrix.python-version == '3.11' || matrix.python-version == '3.12') && inputs.package-name == 'numpy' && contains(inputs.package-version, '1.21'))"
env:
ARRAY_API_TESTS_MODULE: array_api_compat.${{ inputs.module-name || inputs.package-name }}
# This enables the NEP 50 type promotion behavior (without it a lot of
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/docs-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Docs Build

on: [push, pull_request]

jobs:
docs-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: Install Dependencies
run: |
python -m pip install -r docs/requirements.txt
- name: Build Docs
run: |
cd docs
make html
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: docs-build
path: docs/_build/html
33 changes: 16 additions & 17 deletions .github/workflows/docs.yml → .github/workflows/docs-deploy.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,29 @@
name: Docs
on: [push, pull_request]
name: Docs Deploy

on:
push:
branches:
- main

jobs:
docs:
docs-deploy:
runs-on: ubuntu-latest
strategy:
fail-fast: false
environment:
name: docs-build-and-deploy
name: docs-deploy
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- name: Install Dependencies
run: |
python -m pip install -r docs/requirements.txt
- name: Build Docs
run: |
cd docs
make html
- uses: actions/checkout@v4
- name: Download Artifact
uses: dawidd6/action-download-artifact@v2
with:
workflow: docs-build.yml
name: docs-build
path: docs/_build/html

# Note, the gh-pages deployment requires setting up a SSH deploy key.
# See
# https://github.com/JamesIves/github-pages-deploy-action/tree/dev#using-an-ssh-deploy-key-
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
if: ${{ github.ref == 'refs/heads/main' }}
with:
folder: docs/_build/html
ssh-key: ${{ secrets.DEPLOY_KEY }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/publish-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:

publish:
name: Publish Python distribution to (Test)PyPI
if: github.event_name != 'pull_request' && github.repository == 'data-apis/array-api-compat'
if: github.event_name != 'pull_request' && github.repository == 'data-apis/array-api-compat' && github.ref_type == 'tag'
needs: build
runs-on: ubuntu-latest
# Mandatory for publishing with a trusted publisher
Expand Down Expand Up @@ -94,19 +94,19 @@ jobs:
if: >-
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags'))
|| (github.event_name == 'workflow_dispatch' && github.event.inputs.publish == 'true')
uses: pypa/gh-action-pypi-publish@v1.8.12
uses: pypa/gh-action-pypi-publish@v1.8.14
with:
repository-url: https://test.pypi.org/legacy/
print-hash: true

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

- name: Publish distribution 📦 to PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@v1.8.12
uses: pypa/gh-action-pypi-publish@v1.8.14
with:
print-hash: true
24 changes: 20 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
python-version: ['3.9', '3.10', '3.11', '3.12']
numpy-version: ['1.21', '1.26', 'dev']
exclude:
- python-version: '3.11'
numpy-version: '1.21'
- python-version: '3.12'
numpy-version: '1.21'
fail-fast: true
steps:
- uses: actions/checkout@v4
Expand All @@ -15,11 +21,21 @@ jobs:
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements-dev.txt
if [ "${{ matrix.numpy-version }}" == "dev" ]; then
PIP_EXTRA='numpy --pre --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple'
elif [ "${{ matrix.numpy-version }}" == "1.21" ]; then
PIP_EXTRA='numpy==1.21.*'
else
PIP_EXTRA='numpy==1.26.*'
fi
python -m pip install -r requirements-dev.txt $PIP_EXTRA
- name: Run Tests
run: |
pytest
if [[ "${{ matrix.numpy-version }}" == "1.21" || "${{ matrix.numpy-version }}" == "dev" ]]; then
PYTEST_EXTRA=(-k "numpy and not jax and not torch and not dask")
fi
pytest -v "${PYTEST_EXTRA[@]}"
# Make sure it installs
python setup.py install
python -m pip install .
163 changes: 0 additions & 163 deletions CHANGELOG.md

This file was deleted.

1 change: 1 addition & 0 deletions CHANGELOG.md
2 changes: 1 addition & 1 deletion array_api_compat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
this implementation for the default when working with NumPy arrays.
"""
__version__ = '1.5'
__version__ = '1.5.1'

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

0 comments on commit 1d66ff7

Please sign in to comment.