diff --git a/.github/workflows/test_and_build.yml b/.github/workflows/test_and_build.yml index d22bf8014..c5417db20 100644 --- a/.github/workflows/test_and_build.yml +++ b/.github/workflows/test_and_build.yml @@ -126,9 +126,48 @@ jobs: run: | # Install dependencies based on the needs of the job. # Don't panic! This may look scary at a glance, but each line makes sense. + # + # First let's randomly get versions of dependencies to install + nxver=$(python -c 'import random ; print(random.choice(["=2.7", "=2.8", "=3.0", ""]))') + yamlver=$(python -c 'import random ; print(random.choice(["=5.4", "=6.0", ""]))') + if [[ ${{ steps.pyver.outputs.selected }} == "3.8" ]]; then + npver=$(python -c 'import random ; print(random.choice(["=1.21", "=1.22", "=1.23", ""]))') + spver=$(python -c 'import random ; print(random.choice(["=1.8", "=1.9", "=1.10", ""]))') + pdver=$(python -c 'import random ; print(random.choice(["=1.2", "=1.3", "=1.4", "=1.5", ""]))') + akver=$(python -c 'import random ; print(random.choice(["=1.9", "=1.10", "=2.0", ""]))') + elif [[ ${{ steps.pyver.outputs.selected }} == "3.9" ]]; then + npver=$(python -c 'import random ; print(random.choice(["=1.21", "=1.22", "=1.23", ""]))') + spver=$(python -c 'import random ; print(random.choice(["=1.8", "=1.9", "=1.10", ""]))') + pdver=$(python -c 'import random ; print(random.choice(["=1.2", "=1.3", "=1.4", "=1.5", ""]))') + akver=$(python -c 'import random ; print(random.choice(["=1.9", "=1.10", "=2.0", ""]))') + elif [[ ${{ steps.pyver.outputs.selected }} == "3.10" ]]; then + npver=$(python -c 'import random ; print(random.choice(["=1.21", "=1.22", "=1.23", ""]))') + spver=$(python -c 'import random ; print(random.choice(["=1.8", "=1.9", "=1.10", ""]))') + pdver=$(python -c 'import random ; print(random.choice(["=1.3", "=1.4", "=1.5", ""]))') + akver=$(python -c 'import random ; print(random.choice(["=1.9", "=1.10", "=2.0", ""]))') + else # Python 3.11 + npver=$(python -c 'import random ; print(random.choice(["=1.23", ""]))') + spver=$(python -c 'import random ; print(random.choice(["=1.9", "=1.10", ""]))') + pdver=$(python -c 'import random ; print(random.choice(["=1.5", ""]))') + akver=$(python -c 'import random ; print(random.choice(["=1.10", "=2.0", ""]))') + fi + if [[ ${{ steps.sourcetype.outputs.selected }} == "source" || ${{ steps.sourcetype.outputs.selected }} == "upstream" ]]; then + # TODO: there are currently issues with some numpy versions when + # installing python-suitesparse-grphblas from source or upstream. + npver="" + spver="" + pdver="" + fi + if [[ $npver == "=1.21" ]] ; then + numbaver=$(python -c 'import random ; print(random.choice(["=0.55", "=0.56", ""]))') + else + numbaver=$(python -c 'import random ; print(random.choice(["=0.56", ""]))') + fi + echo "versions: np${npver} sp${spver} pd${pdver} ak${akver} nx${nxver} numba${numbaver} yaml${yamlver}" + # Once we have wheels for all OSes, we can delete the last two lines. - mamba install pytest coverage coveralls=3.3.1 pytest-randomly \ - pandas numba scipy networkx cffi donfig pyyaml awkward \ + mamba install pytest coverage coveralls=3.3.1 pytest-randomly cffi donfig pyyaml${yamlver} \ + pandas${pdver} scipy${spver} numpy${npver} awkward${akver} networkx${nxver} numba${numbaver} \ ${{ matrix.slowtask == 'pylint' && 'black pylint' || '' }} \ ${{ matrix.slowtask == 'notebooks' && 'matplotlib nbconvert jupyter "ipython>=7"' || '' }} \ ${{ steps.sourcetype.outputs.selected == 'upstream' && 'cython' || '' }} \ diff --git a/graphblas/io.py b/graphblas/io.py index 6d98a5969..b29c483c5 100644 --- a/graphblas/io.py +++ b/graphblas/io.py @@ -382,7 +382,7 @@ def to_awkward(A, format=None): awkward.Array """ - try: # pragma: no cover (import) + try: # awkward version 1 import awkward._v2 as ak from awkward._v2.forms.listoffsetform import ListOffsetForm diff --git a/scripts/check_versions.sh b/scripts/check_versions.sh new file mode 100755 index 000000000..8a9af5a3b --- /dev/null +++ b/scripts/check_versions.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +# Simple helper to check versions of dependencies. +# Use, adjust, copy/paste, etc. as necessary to answer your questions. +# This may be helpful when updating dependency versions in CI. +# Tip: add `--json` for more information. +conda search 'numpy[channel=conda-forge]>=1.24.1' +conda search 'pandas[channel=conda-forge]>=1.5.2' +conda search 'scipy[channel=conda-forge]>=1.10.0' +conda search 'networkx[channel=conda-forge]>=3.0' +conda search 'awkward[channel=conda-forge]>=2.0.5' +conda search 'numba[channel=conda-forge]>=0.56.4' +conda search 'pyyaml[channel=conda-forge]>=6.0' diff --git a/setup.py b/setup.py index ecb472ff7..70dd662c4 100644 --- a/setup.py +++ b/setup.py @@ -1,10 +1,10 @@ from setuptools import find_packages, setup extras_require = { - "repr": ["pandas"], - "io": ["networkx", "scipy >=1.7.0", "awkward"], + "repr": ["pandas >=1.2"], + "io": ["networkx >=2.8", "scipy >=1.8", "awkward >=1.9"], "viz": ["matplotlib"], - "test": ["pytest", "pandas", "scipy >=1.7.0"], + "test": ["pytest", "pandas >=1.2", "scipy >=1.8"], } extras_require["complete"] = sorted({v for req in extras_require.values() for v in req}) @@ -24,7 +24,13 @@ url="https://github.com/python-graphblas/python-graphblas", packages=find_packages(), python_requires=">=3.8", - install_requires=["suitesparse-graphblas >=7.4.0.0, <7.5", "numba", "donfig", "pyyaml"], + install_requires=[ + "suitesparse-graphblas >=7.4.0.0, <7.5", + "numpy >=1.21", + "numba >=0.55", + "donfig >=0.6", + "pyyaml >=5.4", + ], extras_require=extras_require, include_package_data=True, license="Apache License 2.0",