Skip to content

Commit 52175c4

Browse files
authored
Merge pull request #3 from asmeurer/update-ci
Fixup CI
2 parents fec3a67 + 7719dff commit 52175c4

11 files changed

+3043
-12
lines changed

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
array_api_strict/_version.py export-subst

.github/workflows/array-api-tests.yml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Array API Tests
2+
3+
env:
4+
PYTEST_ARGS: "-v -rxXfE --ci"
5+
6+
jobs:
7+
tests:
8+
runs-on: ubuntu-latest
9+
strategy:
10+
matrix:
11+
python-version: ['3.9', '3.10', '3.11', '3.12']
12+
numpy-version: ['1.26', 'dev']
13+
exclude:
14+
- python-version: '3.8'
15+
numpy-version: 'dev'
16+
17+
steps:
18+
- name: Checkout array-api-strict
19+
uses: actions/checkout@v4
20+
with:
21+
path: array-api-strict
22+
- name: Checkout array-api-tests
23+
uses: actions/checkout@v4
24+
with:
25+
repository: data-apis/array-api-tests
26+
submodules: 'true'
27+
path: array-api-tests
28+
- name: Set up Python ${{ matrix.python-version }}
29+
uses: actions/setup-python@v5
30+
with:
31+
python-version: ${{ matrix.python-version }}
32+
- name: Install Dependencies
33+
run: |
34+
python -m pip install --upgrade pip
35+
if [[ "${{ matrix.numpy-version }}" == "dev" ]]; then
36+
python -m pip install --pre --extra-index https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy;
37+
else
38+
python -m pip install 'numpy>=1.26,<2.0';
39+
fi
40+
- name: Run the array API testsuite
41+
env:
42+
ARRAY_API_TESTS_MODULE: array_api_strict
43+
# This enables the NEP 50 type promotion behavior (without it a lot of
44+
# tests fail in numpy 1.26 on bad scalar type promotion behavior)
45+
NPY_PROMOTION_STATE: weak
46+
run: |
47+
export PYTHONPATH="${GITHUB_WORKSPACE}/array-api-compat"
48+
cd ${GITHUB_WORKSPACE}/array-api-tests
49+
pytest array_api_tests/ --xfails-file ${PYTEST_ARGS}

.github/workflows/publish-package.yml

+3
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ jobs:
4545
python -m pip install build twine
4646
python -m pip list
4747
48+
- name: Install dependencies
49+
run: python -m pip install -r requirements.txt
50+
4851
- name: Build a wheel and a sdist
4952
run: |
5053
PYTHONWARNINGS=error,default::DeprecationWarning python -m build .

.github/workflows/tests.yml

+5-4
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ jobs:
55
runs-on: ubuntu-latest
66
strategy:
77
matrix:
8-
python-version: ['3.8', '3.9', '3.10', '3.11']
9-
numpy-version: ['1', 'dev']
8+
python-version: ['3.9', '3.10', '3.11', '3.12']
9+
numpy-version: ['1.26', 'dev']
1010
exclude:
1111
- python-version: '3.8'
1212
numpy-version: 'dev'
@@ -22,11 +22,12 @@ jobs:
2222
if [[ "${{ matrix.numpy-version }}" == "dev" ]]; then
2323
python -m pip install --pre --extra-index https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy;
2424
else
25-
python -m pip install numpy<2.0;
25+
python -m pip install 'numpy>=1.26,<2.0';
2626
fi
27+
python -m pip install -r requirements-dev.txt
2728
- name: Run Tests
2829
run: |
2930
pytest
3031
3132
# Make sure it installs
32-
python setup.py install
33+
pip install .

array_api_strict/__init__.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,6 @@
115115
116116
"""
117117

118-
__version__ = '1.0'
119-
120118
__array_api_version__ = "2022.12"
121119

122120
__all__ = ["__array_api_version__"]
@@ -384,3 +382,7 @@
384382
from ._utility_functions import all, any
385383

386384
__all__ += ["all", "any"]
385+
386+
from . import _version
387+
__version__ = _version.get_versions()['version']
388+
del _version

0 commit comments

Comments
 (0)