From 61648985185f0a80ac03ae4961dae95c47877b34 Mon Sep 17 00:00:00 2001 From: Jim Kitchen Date: Thu, 26 Sep 2024 10:16:41 -0500 Subject: [PATCH] Add support for numpy 2 --- .github/workflows/test.yml | 2 +- .github/workflows/wheels.yml | 3 +++ .pre-commit-config.yaml | 24 ++++++++++++------------ pyproject.toml | 15 +++++---------- suitesparse_graphblas/create_headers.py | 1 + 5 files changed, 22 insertions(+), 23 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8bbc36a..9d93520 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,7 +18,7 @@ jobs: source: ["conda-forge"] # os: ["ubuntu-latest"] # source: ["source"] - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + python-version: ["3.9", "3.10", "3.11", "3.12"] steps: - name: Checkout uses: actions/checkout@v4 diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index fb7acdf..66709cc 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -170,6 +170,9 @@ jobs: # SUITESPARSE_MACOS_ARCH asks to build a particular architecture. Either x86 or arm64. CIBW_ENVIRONMENT_MACOS: BREW_LIBOMP="1" SUITESPARSE_MACOS_ARCH=${{ matrix.cibw_archs }} + # Select CPython and PyPy for 3.9, 3.10, 3.11, 3.12 + CIBW_BUILD: "{c,p}p3{9,10,11,12}-*" + # Uncomment to only build CPython wheels # CIBW_BUILD: "cp*" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 64bed06..a2c17d8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,7 +9,7 @@ default_language_version: python: python3 repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.6.0 hooks: - id: check-added-large-files - id: check-ast @@ -20,43 +20,43 @@ repos: - id: mixed-line-ending # - id: trailing-whitespace - repo: https://github.com/abravalheri/validate-pyproject - rev: v0.14 + rev: v0.19 hooks: - id: validate-pyproject name: Validate pyproject.toml - repo: https://github.com/PyCQA/autoflake - rev: v2.2.1 + rev: v2.3.1 hooks: - id: autoflake args: [--in-place] - repo: https://github.com/pycqa/isort - rev: 5.12.0 + rev: 5.13.2 hooks: - id: isort - repo: https://github.com/asottile/pyupgrade - rev: v3.13.0 + rev: v3.17.0 hooks: - id: pyupgrade - args: [--py38-plus] + args: [--py39-plus] # - repo: https://github.com/MarcoGorelli/auto-walrus # rev: v0.2.2 # hooks: # - id: auto-walrus # args: [--line-length, "100"] - repo: https://github.com/psf/black - rev: 23.9.1 + rev: 24.8.0 hooks: - id: black # - id: black-jupyter - repo: https://github.com/PyCQA/flake8 - rev: 6.1.0 + rev: 7.1.1 hooks: - id: flake8 additional_dependencies: &flake8_dependencies # These versions need updated manually - - flake8==6.1.0 - - flake8-comprehensions==3.14.0 - - flake8-bugbear==23.9.16 + - flake8==7.1.1 + - flake8-comprehensions==3.15.0 + - flake8-bugbear==24.8.19 # - flake8-simplify==0.20.0 - repo: https://github.com/asottile/yesqa rev: v1.5.0 @@ -71,6 +71,6 @@ repos: # - id: pyroma # args: [-n, "10", .] - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.6.0 hooks: - id: no-commit-to-branch # no commit directly to main diff --git a/pyproject.toml b/pyproject.toml index bff0249..058429b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,10 +6,7 @@ requires = [ "wheel", "cffi>=1.11", "cython", - "oldest-supported-numpy; platform_python_implementation != 'PyPy'", - # Inspired by SciPy: unpin numpy version for PyPy builds, - # as oldest-supported-numpy does not take PyPy into account. - "numpy; platform_python_implementation=='PyPy'", + "numpy>=2.0", ] [project] @@ -17,7 +14,7 @@ name = "suitesparse-graphblas" dynamic = ["version"] description = "SuiteSparse:GraphBLAS Python bindings." readme = "README.md" -requires-python = ">=3.8" +requires-python = ">=3.9" license = {file = "LICENSE"} authors = [ {name = "Erik Welch", email = "erik.n.welch@gmail.com"}, @@ -53,7 +50,6 @@ classifiers = [ "Operating System :: Microsoft :: Windows", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", @@ -68,9 +64,8 @@ classifiers = [ "Topic :: Software Development :: Libraries :: Python Modules", ] dependencies = [ - # These are super-old; can/should we update them? - "cffi>=1.11", - "numpy>=1.19", + "cffi>=1.15", + "numpy>=1.23", ] [project.urls] homepage = "https://github.com/GraphBLAS/python-suitesparse-graphblas" @@ -96,7 +91,7 @@ dirty_template = "{tag}+{ccount}.g{sha}.dirty" [tool.black] line-length = 100 -target-version = ["py38", "py39", "py310", "py311"] +target-version = ["py39", "py310", "py311", "py312"] [tool.isort] sections = ["FUTURE", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"] diff --git a/suitesparse_graphblas/create_headers.py b/suitesparse_graphblas/create_headers.py index 89c199c..d63462d 100644 --- a/suitesparse_graphblas/create_headers.py +++ b/suitesparse_graphblas/create_headers.py @@ -21,6 +21,7 @@ Run `python create_headers.py --help` to see more help. """ + import argparse import os import re