From 766a15a37bc7a317daf62361e8af7fafcd2ec258 Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Sun, 22 Oct 2023 09:46:03 -0500 Subject: [PATCH] Handle numpy 1.21 and pandas 2.1 incompatibility (& more maint) --- .github/workflows/test_and_build.yml | 7 ++++++- .pre-commit-config.yaml | 8 ++++---- pyproject.toml | 2 +- scripts/check_versions.sh | 4 ++-- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test_and_build.yml b/.github/workflows/test_and_build.yml index d4504e2fd..56d13557f 100644 --- a/.github/workflows/test_and_build.yml +++ b/.github/workflows/test_and_build.yml @@ -166,10 +166,11 @@ jobs: # # First let's randomly get versions of dependencies to install. # Consider removing old versions when they become problematic or very old (>=2 years). - nxver=$(python -c 'import random ; print(random.choice(["=2.7", "=2.8", "=3.0", "=3.1", ""]))') + nxver=$(python -c 'import random ; print(random.choice(["=2.7", "=2.8", "=3.0", "=3.1", "=3.2", ""]))') yamlver=$(python -c 'import random ; print(random.choice(["=5.4", "=6.0", ""]))') sparsever=$(python -c 'import random ; print(random.choice(["=0.13", "=0.14", ""]))') fmmver=$(python -c 'import random ; print(random.choice(["=1.4", "=1.5", "=1.6", "=1.7", ""]))') + # Randomly choosing versions of dependencies based on Python version works surprisingly well... if [[ ${{ startsWith(steps.pyver.outputs.selected, '3.9') }} == true ]]; then npver=$(python -c 'import random ; print(random.choice(["=1.21", "=1.22", "=1.23", "=1.24", "=1.25", "=1.26", ""]))') spver=$(python -c 'import random ; print(random.choice(["=1.8", "=1.9", "=1.10", "=1.11", ""]))') @@ -191,6 +192,10 @@ jobs: pdver=$(python -c 'import random ; print(random.choice(["=2.1", ""]))') akver=$(python -c 'import random ; print(random.choice(["=2.4", ""]))') fi + # But there may be edge cases of incompatibility we need to handle (more handled below) + if [[ ${pdver} == "=2.1" && ${npver} == "=1.21" ]]; then + pdver="=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. diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 96c8b9aeb..b2e08e638 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -61,12 +61,12 @@ repos: - id: auto-walrus args: [--line-length, "100"] - repo: https://github.com/psf/black - rev: 23.9.1 + rev: 23.10.0 hooks: - id: black - id: black-jupyter - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.0.292 + rev: v0.1.1 hooks: - id: ruff args: [--fix-only, --show-fixes] @@ -94,11 +94,11 @@ repos: additional_dependencies: [tomli] files: ^(graphblas|docs)/ - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.0.292 + rev: v0.1.1 hooks: - id: ruff - repo: https://github.com/sphinx-contrib/sphinx-lint - rev: v0.8.0 + rev: v0.8.1 hooks: - id: sphinx-lint args: [--enable, all, "--disable=line-too-long,leaked-markup"] diff --git a/pyproject.toml b/pyproject.toml index 9579b1c16..04ef28645 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -87,7 +87,7 @@ pandas = [ "pandas >=1.2", ] scipy = [ - "scipy >=1.8", + "scipy >=1.9", ] suitesparse-udf = [ # udf requires numba "python-graphblas[suitesparse,numba]", diff --git a/scripts/check_versions.sh b/scripts/check_versions.sh index dc0331359..7c09bc168 100755 --- a/scripts/check_versions.sh +++ b/scripts/check_versions.sh @@ -8,10 +8,10 @@ conda search 'flake8-simplify[channel=conda-forge]>=0.21.0' conda search 'numpy[channel=conda-forge]>=1.26.0' conda search 'pandas[channel=conda-forge]>=2.1.1' conda search 'scipy[channel=conda-forge]>=1.11.3' -conda search 'networkx[channel=conda-forge]>=3.1' +conda search 'networkx[channel=conda-forge]>=3.2' conda search 'awkward[channel=conda-forge]>=2.4.6' conda search 'sparse[channel=conda-forge]>=0.14.0' -conda search 'fast_matrix_market[channel=conda-forge]>=1.7.3' +conda search 'fast_matrix_market[channel=conda-forge]>=1.7.4' conda search 'numba[channel=conda-forge]>=0.57.1' conda search 'pyyaml[channel=conda-forge]>=6.0.1' # conda search 'python[channel=conda-forge]>=3.9 *pypy*'