From 2a4891f9b1701afe3019f4d9cfcca3f9c7e505b8 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Mon, 17 Feb 2025 17:06:11 -0600 Subject: [PATCH 1/2] Fix a numpy 2 deprecation warning (dtype "a" code) (#556) --- graphblas/tests/test_dtype.py | 4 ++++ scripts/check_versions.sh | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/graphblas/tests/test_dtype.py b/graphblas/tests/test_dtype.py index e2478fe7b..ecbca707f 100644 --- a/graphblas/tests/test_dtype.py +++ b/graphblas/tests/test_dtype.py @@ -9,6 +9,7 @@ import graphblas as gb from graphblas import core, dtypes from graphblas.core import lib +from graphblas.core.utils import _NP2 from graphblas.dtypes import lookup_dtype suitesparse = gb.backend == "suitesparse" @@ -228,6 +229,9 @@ def test_dtype_to_from_string(): # See NEP 55 about StringDtype "T". Notably, this doesn't work: # >>> np.dtype(np.dtype("T").str) continue + if _NP2 and c == "a": + # Data type alias 'a' was deprecated in NumPy 2.0. Use the 'S' alias instead. + continue try: dtype = np.dtype(c) types.append(dtype) diff --git a/scripts/check_versions.sh b/scripts/check_versions.sh index cd3451905..5aa88e045 100755 --- a/scripts/check_versions.sh +++ b/scripts/check_versions.sh @@ -7,7 +7,7 @@ conda search 'flake8-bugbear[channel=conda-forge]>=24.12.12' conda search 'flake8-simplify[channel=conda-forge]>=0.21.0' conda search 'numpy[channel=conda-forge]>=2.2.3' conda search 'pandas[channel=conda-forge]>=2.2.3' -conda search 'scipy[channel=conda-forge]>=1.15.1' +conda search 'scipy[channel=conda-forge]>=1.15.2' conda search 'networkx[channel=conda-forge]>=3.4.2' conda search 'awkward[channel=conda-forge]>=2.7.4' conda search 'sparse[channel=conda-forge]>=0.15.5' From 22d42f615187a3a2c89b6400a898c5b72ef396a8 Mon Sep 17 00:00:00 2001 From: Jim Kitchen <2807270+jim22k@users.noreply.github.com> Date: Wed, 26 Feb 2025 10:02:04 -0600 Subject: [PATCH 2/2] Add 9.4.5.0 to tests (#557) --- .github/workflows/test_and_build.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test_and_build.yml b/.github/workflows/test_and_build.yml index bfc17834b..af7525928 100644 --- a/.github/workflows/test_and_build.yml +++ b/.github/workflows/test_and_build.yml @@ -217,24 +217,24 @@ jobs: fi elif [[ ${{ startsWith(steps.pyver.outputs.selected, '3.13') }} == true ]] ; then if [[ ${{ steps.sourcetype.outputs.selected}} == "conda-forge" ]] ; then - psgver=$(python -c 'import random ; print(random.choice(["=9.3.1.0", ""]))') + psgver=$(python -c 'import random ; print(random.choice(["=9.3.1.0", "=9.4.5.0", ""]))') psg=python-suitesparse-graphblas${psgver} else - psgver=$(python -c 'import random ; print(random.choice(["==9.3.1.0", ""]))') + psgver=$(python -c 'import random ; print(random.choice(["==9.3.1.0", "==9.4.5.0", ""]))') fi elif [[ ${{ startsWith(steps.pyver.outputs.selected, '3.12') }} == true ]] ; then if [[ ${{ steps.sourcetype.outputs.selected}} == "conda-forge" ]] ; then if [[ $npver == =1.* ]] ; then psgver=$(python -c 'import random ; print(random.choice(["=8.2.0.1", "=8.2.1.0"]))') else - psgver=$(python -c 'import random ; print(random.choice(["=9.3.1.0", ""]))') + psgver=$(python -c 'import random ; print(random.choice(["=9.3.1.0", "=9.4.5.0", ""]))') fi psg=python-suitesparse-graphblas${psgver} else if [[ $npver == =1.* ]] ; then psgver=$(python -c 'import random ; print(random.choice(["==8.2.0.1", "==8.2.1.0"]))') else - psgver=$(python -c 'import random ; print(random.choice(["==9.3.1.0", ""]))') + psgver=$(python -c 'import random ; print(random.choice(["==9.3.1.0", "==9.4.5.0", ""]))') fi fi # python-suitsparse-graphblas support is the same for Python 3.10 and 3.11 @@ -242,21 +242,21 @@ jobs: if [[ $npver == =1.* ]] ; then psgver=$(python -c 'import random ; print(random.choice(["=7.4.0", "=7.4.1", "=7.4.2", "=7.4.3.0", "=7.4.3.1", "=7.4.3.2", "=8.0.2.1", "=8.2.0.1", "=8.2.1.0"]))') else - psgver=$(python -c 'import random ; print(random.choice(["=9.3.1.0", ""]))') + psgver=$(python -c 'import random ; print(random.choice(["=9.3.1.0", "=9.4.5.0", ""]))') fi psg=python-suitesparse-graphblas${psgver} elif [[ ${{ steps.sourcetype.outputs.selected}} == "wheel" ]] ; then if [[ $npver == =1.* ]] ; then psgver=$(python -c 'import random ; print(random.choice(["==7.4.3.2", "==8.0.2.1", "==8.2.0.1", "==8.2.1.0"]))') else - psgver=$(python -c 'import random ; print(random.choice(["==9.3.1.0", ""]))') + psgver=$(python -c 'import random ; print(random.choice(["==9.3.1.0", "==9.4.5.0", ""]))') fi elif [[ ${{ steps.sourcetype.outputs.selected}} == "source" ]] ; then # These should be exact versions if [[ $npver == =1.* ]] ; then psgver=$(python -c 'import random ; print(random.choice(["==7.4.0.0", "==7.4.1.0", "==7.4.2.0", "==7.4.3.0", "==7.4.3.1", "==7.4.3.2", "==8.0.2.1", "==8.2.0.1", "==8.2.1.0"]))') else - psgver=$(python -c 'import random ; print(random.choice(["==9.3.1.0", ""]))') + psgver=$(python -c 'import random ; print(random.choice(["==9.3.1.0", "==9.4.5.0", ""]))') fi fi @@ -357,7 +357,7 @@ jobs: ${{ matrix.slowtask == 'pytest_bizarro' && 'black' || '' }} \ ${{ matrix.slowtask == 'notebooks' && 'matplotlib nbconvert jupyter "ipython>=7" drawsvg' || '' }} \ ${{ steps.sourcetype.outputs.selected == 'upstream' && 'cython' || '' }} \ - ${{ steps.sourcetype.outputs.selected != 'wheel' && '"graphblas>=7.4,<9.4"' || '' }} \ + ${{ steps.sourcetype.outputs.selected != 'wheel' && '"graphblas>=7.4,<9.5"' || '' }} \ ${{ contains(steps.pyver.outputs.selected, 'pypy') && 'pypy' || '' }} \ ${{ matrix.os == 'windows-latest' && 'cmake' || 'm4' }} \ # ${{ matrix.os != 'windows-latest' && 'pytest-forked' || '' }} # to investigate crashes