Skip to content

Commit bfc524c

Browse files
authored
Merge pull request #173 from ev-br/py314_on_ci
CI: test on python 3.14
2 parents f87ad8d + 3ad5509 commit bfc524c

File tree

4 files changed

+27
-16
lines changed

4 files changed

+27
-16
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,17 @@ jobs:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
python-version: ['3.10', '3.11', '3.12', '3.13']
15-
numpy-version: ['1.26', '2.3', 'dev']
14+
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
15+
numpy-version: ['1.26', '2.3.5', 'dev']
1616
exclude:
1717
- python-version: '3.10'
18-
numpy-version: '2.3'
18+
numpy-version: '2.3.5'
1919
- python-version: '3.10'
2020
numpy-version: 'dev'
2121
- python-version: '3.13'
2222
numpy-version: '1.26'
23+
- python-version: '3.14'
24+
numpy-version: '1.26'
2325
fail-fast: false
2426
steps:
2527
- name: Checkout array-api-strict

.github/workflows/tests.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,17 @@ jobs:
55
runs-on: ubuntu-latest
66
strategy:
77
matrix:
8-
python-version: ['3.10', '3.11', '3.12', '3.13']
9-
numpy-version: ['1.26', '2.3', 'dev']
8+
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
9+
numpy-version: ['1.26', '2.3.5', 'dev']
1010
exclude:
1111
- python-version: '3.10'
12-
numpy-version: '2.3'
12+
numpy-version: '2.3.5'
1313
- python-version: '3.10'
1414
numpy-version: 'dev'
1515
- python-version: '3.13'
1616
numpy-version: '1.26'
17+
- python-version: '3.14'
18+
numpy-version: '1.26'
1719
fail-fast: false
1820
steps:
1921
- uses: actions/checkout@v6
@@ -26,9 +28,10 @@ jobs:
2628
if [[ "${{ matrix.numpy-version }}" == "dev" ]]; then
2729
python -m pip install --pre --extra-index https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy;
2830
else
29-
python -m pip install 'numpy>=1.26,<2.0';
31+
python -m pip install 'numpy=='${{ matrix.numpy-version }}
3032
fi
31-
python -m pip install -r requirements-dev.txt
33+
python -m pip install pytest hypothesis
34+
python -c'import numpy as np; print(f"{np.__version__ = }")'
3235
- name: Run Tests
3336
run: |
3437
pytest

array_api_strict/tests/test_array_object.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import sys
2+
import warnings
23
import operator
34
from builtins import all as all_
45

5-
from numpy.testing import assert_raises, suppress_warnings
6+
from numpy.testing import assert_raises
67
import numpy as np
78
import pytest
89

@@ -269,10 +270,12 @@ def _check_op_array_scalar(dtypes, a, s, func, func_name, BIG_INT=BIG_INT):
269270

270271
else:
271272
# Only test for no error
272-
with suppress_warnings() as sup:
273+
with warnings.catch_warnings():
273274
# ignore warnings from pow(BIG_INT)
274-
sup.filter(RuntimeWarning,
275-
"invalid value encountered in power")
275+
warnings.filterwarnings(
276+
"ignore", category=RuntimeWarning,
277+
message="invalid value encountered in power"
278+
)
276279
func(s)
277280
return True
278281

array_api_strict/tests/test_elementwise_functions.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
import warnings
12
from inspect import signature, getmodule
23

34
import numpy as np
45
import pytest
5-
from numpy.testing import suppress_warnings
66

77

88
from .. import asarray, _elementwise_functions
@@ -300,10 +300,13 @@ def _array_vals():
300300
if allowed:
301301
conv_scalar = a._promote_scalar(s)
302302

303-
with suppress_warnings() as sup:
303+
with warnings.catch_warnings():
304304
# ignore warnings from pow(BIG_INT)
305-
sup.filter(RuntimeWarning,
306-
"invalid value encountered in power")
305+
warnings.filterwarnings(
306+
"ignore", category=RuntimeWarning,
307+
message="invalid value encountered in power"
308+
)
309+
307310
assert func(s, a) == func(conv_scalar, a)
308311
assert func(a, s) == func(a, conv_scalar)
309312

0 commit comments

Comments
 (0)