Skip to content

Commit c97eee7

Browse files
committed
Update to GraphBLAS 10.3.1, drop Python 3.10, modernize packaging and CI
- Update SuiteSparse:GraphBLAS from 10.1.1 to 10.3.1 - Regenerate headers (GPU_ID -> GPU_IDS, add NGPUS, PRINT_FUNCTION) - Drop Python 3.10 support (minimum now 3.11) - PEP 639: license = "Apache-2.0" with license-files - Bump setuptools >= 77, numpy >= 1.24 - Update CI: cibuildwheel v2 -> v3.4, checkout v6, QEMU v4, create-pull-request v8 - Enable PyPy and free-threading explicitly (CIBW_ENABLE) - Fix manylinux_2_28 package manager (dnf instead of yum) - Update pre-commit hooks (black 26.3.1, isort 8.0.1, pyupgrade 3.21.2, etc.) - Add shellcheck, pygrep-hooks; enable check-executables-have-shebangs - Fix shellcheck warnings in docker_build.sh and suitesparse.sh
1 parent 5fc0ec0 commit c97eee7

File tree

13 files changed

+97
-69
lines changed

13 files changed

+97
-69
lines changed

.github/workflows/lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ jobs:
1414
name: pre-commit-hooks
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/checkout@v5
17+
- uses: actions/checkout@v6
1818
with:
1919
fetch-depth: 0
2020
persist-credentials: false
2121
- uses: actions/setup-python@v6
2222
with:
23-
python-version: "3.10"
23+
python-version: "3.11"
2424
- uses: pre-commit/action@v3.0.1

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ jobs:
1818
source: ["conda-forge"]
1919
# os: ["ubuntu-latest"]
2020
# source: ["source"]
21-
python-version: [ "3.10", "3.11", "3.12", "3.13", "3.14"]
21+
python-version: ["3.11", "3.12", "3.13", "3.14"]
2222
steps:
2323
- name: Checkout
24-
uses: actions/checkout@v5
24+
uses: actions/checkout@v6
2525
with:
2626
fetch-depth: 0
2727
persist-credentials: false

.github/workflows/update_graphblas.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
if: github.repository == 'GraphBLAS/python-suitesparse-graphblas' || github.repository == 'alugowski/python-suitesparse-graphblas'
2828
runs-on: ubuntu-latest
2929
steps:
30-
- uses: actions/checkout@v5
30+
- uses: actions/checkout@v6
3131
with:
3232
fetch-depth: 0
3333
persist-credentials: false
@@ -43,7 +43,7 @@ jobs:
4343
shell: bash
4444

4545
- name: Create Pull Request
46-
uses: peter-evans/create-pull-request@v7
46+
uses: peter-evans/create-pull-request@v8
4747
with:
4848
# See documentation: https://github.com/peter-evans/create-pull-request
4949
# Action behavior: https://github.com/peter-evans/create-pull-request#action-behaviour

.github/workflows/wheels.yml

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
name: Build SDist
3535
runs-on: ubuntu-latest
3636
steps:
37-
- uses: actions/checkout@v5
37+
- uses: actions/checkout@v6
3838
with:
3939
fetch-depth: 0
4040
persist-credentials: false
@@ -64,8 +64,8 @@ jobs:
6464
# Linux x86 manylinux
6565
- os: ubuntu-latest
6666
cibw_archs: "x86_64"
67-
# Python 3.12 wheel requires libffi-devel to be installed. manylinux container uses yum
68-
cibw_before_build_linux: "yum install -y libffi-devel"
67+
# manylinux_2_28 uses dnf (not yum). libffi-devel needed for Python 3.12+ cffi.
68+
cibw_before_build_linux: "dnf install -y libffi-devel || yum install -y libffi-devel || true"
6969
# skip musllinux
7070
cibw_skip: "*musl*"
7171

@@ -74,15 +74,15 @@ jobs:
7474
- os: ubuntu-latest
7575
cibw_archs: "x86_64"
7676
arch_note: "musl"
77-
# skip manylinux (built elsewhere), PyPy (no musl numpy wheels), CPython 3.8 (no musl numpy wheels)
78-
cibw_skip: "*many* pp* cp38*"
77+
# skip manylinux (built elsewhere)
78+
cibw_skip: "*many*"
7979

8080
# Linux aarch64
8181
# Separate runner because this requires emulation (only x86 runners are available) and is very slow.
8282
- os: ubuntu-latest
8383
cibw_archs: "aarch64"
84-
# numpy wheels not available for aarch64 PyPy or musllinux
85-
cibw_skip: "pp* *musl*"
84+
# numpy wheels not available for aarch64 musllinux
85+
cibw_skip: "*musl*"
8686

8787
# macOS x86
8888
# Note: keep as old as possible as due to libomp this will be the oldest supported macOS version.
@@ -95,7 +95,7 @@ jobs:
9595
cibw_archs: "arm64"
9696

9797
steps:
98-
- uses: actions/checkout@v5
98+
- uses: actions/checkout@v6
9999
with:
100100
fetch-depth: 0
101101
persist-credentials: false
@@ -104,7 +104,7 @@ jobs:
104104
# see https://cibuildwheel.readthedocs.io/en/stable/faq/#emulation
105105
- name: Setup QEMU (for aarch64)
106106
if: matrix.cibw_archs == 'aarch64'
107-
uses: docker/setup-qemu-action@v3
107+
uses: docker/setup-qemu-action@v4
108108
with:
109109
platforms: arm64
110110

@@ -147,13 +147,16 @@ jobs:
147147
brew fetch --retry libomp && brew reinstall libomp
148148
echo MACOSX_DEPLOYMENT_TARGET=$(otool -l $(brew --prefix libomp)/lib/libomp.dylib | grep minos | awk '{print $2}') >> $GITHUB_ENV
149149
150-
- uses: pypa/cibuildwheel@v2.22
150+
- uses: pypa/cibuildwheel@v3.4
151151
with:
152152
output-dir: wheelhouse
153153
env:
154154
# very verbose
155155
CIBW_BUILD_VERBOSITY: 3
156156

157+
# cibuildwheel v3: PyPy and free-threading no longer built by default
158+
CIBW_ENABLE: "pypy cpython-freethreading"
159+
157160
# Build SuiteSparse
158161
CIBW_BEFORE_ALL: bash suitesparse.sh ${{ env.GB_VERSION_REF }}
159162

@@ -174,8 +177,7 @@ jobs:
174177
# Architectures to build specified in matrix
175178
CIBW_ARCHS: ${{ matrix.cibw_archs }}
176179

177-
# as of writing numpy does not support pypy 3.10
178-
CIBW_SKIP: "${{ matrix.cibw_skip }} pp310*"
180+
CIBW_SKIP: "${{ matrix.cibw_skip }}"
179181

180182
# Use delvewheel on Windows.
181183
# This copies graphblas.dll into the wheel. "repair" in cibuildwheel parlance includes copying any shared
@@ -219,7 +221,7 @@ jobs:
219221
merge-multiple: true
220222

221223
# Upload to PyPI
222-
- uses: pypa/gh-action-pypi-publish@release/v1
224+
- uses: pypa/gh-action-pypi-publish@v1.13.0
223225
name: Upload to PyPI
224226
if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.upload_dest == 'PyPI')
225227
with:
@@ -229,7 +231,7 @@ jobs:
229231
password: ${{ secrets.PYPI_TOKEN }}
230232

231233
# Upload to Test PyPI
232-
- uses: pypa/gh-action-pypi-publish@release/v1
234+
- uses: pypa/gh-action-pypi-publish@v1.13.0
233235
name: Upload to Test PyPI
234236
if: github.event_name == 'workflow_dispatch' && github.event.inputs.upload_dest == 'Test PyPI'
235237
with:

.pre-commit-config.yaml

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ repos:
1313
hooks:
1414
- id: check-added-large-files
1515
- id: check-case-conflict
16+
- id: check-executables-have-shebangs
1617
- id: check-illegal-windows-names
1718
- id: check-merge-conflict
1819
- id: check-ast
1920
- id: check-toml
2021
- id: check-yaml
21-
# - id: check-executables-have-shebangs
2222
- id: check-vcs-permalinks
2323
- id: debug-statements
2424
- id: destroyed-symlinks
@@ -31,26 +31,26 @@ repos:
3131
- id: name-tests-test
3232
args: ["--pytest-test-first"]
3333
- repo: https://github.com/abravalheri/validate-pyproject
34-
rev: v0.24.1
34+
rev: v0.25
3535
hooks:
3636
- id: validate-pyproject
3737
name: Validate pyproject.toml
3838
- repo: https://github.com/PyCQA/autoflake
39-
rev: v2.3.1
39+
rev: v2.3.3
4040
hooks:
4141
- id: autoflake
4242
args: [--in-place]
4343
- repo: https://github.com/pycqa/isort
44-
rev: 7.0.0
44+
rev: 8.0.1
4545
hooks:
4646
- id: isort
4747
- repo: https://github.com/asottile/pyupgrade
48-
rev: v3.21.0
48+
rev: v3.21.2
4949
hooks:
5050
- id: pyupgrade
51-
args: [--py310-plus]
51+
args: [--py311-plus]
5252
- repo: https://github.com/psf/black-pre-commit-mirror
53-
rev: 25.9.0
53+
rev: 26.3.1
5454
hooks:
5555
- id: black
5656
- repo: https://github.com/PyCQA/flake8
@@ -62,7 +62,7 @@ repos:
6262
# These versions need updated manually
6363
- flake8==7.3.0
6464
- flake8-comprehensions==3.17.0
65-
- flake8-bugbear==24.12.12
65+
- flake8-bugbear==25.11.29
6666
# - flake8-simplify==0.22.0
6767
- repo: https://github.com/asottile/yesqa
6868
rev: v1.5.0
@@ -72,12 +72,24 @@ repos:
7272
# `pyroma` may help keep our package standards up to date if best practices change.
7373
# This is a "low value" check though and too slow to run as part of pre-commit.
7474
# - repo: https://github.com/regebro/pyroma
75-
# rev: "5.0"
75+
# rev: "5.0.1"
7676
# hooks:
7777
# - id: pyroma
7878
# args: [-n, "10", .]
79+
- repo: https://github.com/shellcheck-py/shellcheck-py
80+
rev: "v0.11.0.1"
81+
hooks:
82+
- id: shellcheck
83+
- repo: https://github.com/pre-commit/pygrep-hooks
84+
rev: v1.10.0
85+
hooks:
86+
- id: python-check-blanket-noqa
87+
- id: python-check-blanket-type-ignore
88+
- id: python-no-eval
89+
- id: python-no-log-warn
90+
- id: text-unicode-replacement-char
7991
- repo: https://github.com/python-jsonschema/check-jsonschema
80-
rev: 0.34.1
92+
rev: 0.37.0
8193
hooks:
8294
- id: check-dependabot
8395
- id: check-github-workflows

GB_VERSION.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
10.1.1
1+
10.3.1

docker_build.sh

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/usr/bin/env bash
12
if [ $# -eq 0 ]
23
then
34
echo "Usage: ./docker_build.sh SUITESPARSE_BRANCH VERSION [BRANCH LOCATION PUSH]
@@ -21,29 +22,29 @@ COMPACT=${COMPACT:-0}
2122
if [ "$LOCATION" = "clone" ]
2223
then
2324
TMPDIR=$(mktemp -d)
24-
if [ ! -e $TMPDIR ]; then
25+
if [ ! -e "$TMPDIR" ]; then
2526
>&2 echo "Failed to create temp directory"
2627
exit 1
2728
fi
2829
trap "exit 1" HUP INT PIPE QUIT TERM
2930
trap 'rm -rf "$TMPDIR"' EXIT
3031

31-
cd $TMPDIR
32-
git clone --branch $BRANCH https://github.com/GraphBLAS/python-suitesparse-graphblas.git
33-
cd python-suitesparse-graphblas
32+
cd "$TMPDIR" || exit
33+
git clone --branch "$BRANCH" https://github.com/GraphBLAS/python-suitesparse-graphblas.git
34+
cd python-suitesparse-graphblas || exit
3435
fi
3536

3637
docker build \
37-
--build-arg SUITESPARSE=${SUITESPARSE} \
38-
--build-arg VERSION=${VERSION} \
39-
--build-arg COMPACT=${COMPACT} \
40-
-t $IMAGE:$VERSION \
38+
--build-arg SUITESPARSE="${SUITESPARSE}" \
39+
--build-arg VERSION="${VERSION}" \
40+
--build-arg COMPACT="${COMPACT}" \
41+
-t "$IMAGE:$VERSION" \
4142
.
4243

43-
docker tag $IMAGE:$VERSION $IMAGE:latest
44+
docker tag "$IMAGE:$VERSION" "$IMAGE:latest"
4445

4546
if [ "$PUSH" = "push" ]
4647
then
47-
docker push $IMAGE:$VERSION
48-
docker push $IMAGE:latest
48+
docker push "$IMAGE:$VERSION"
49+
docker push "$IMAGE:latest"
4950
fi

pyproject.toml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
[build-system]
22
build-backend = "setuptools.build_meta"
33
requires = [
4-
# setuptools<74 until PyPy vendors cffi 1.15.1
5-
"setuptools >=64, <74",
4+
"setuptools >=77",
65
"setuptools-git-versioning",
76
"wheel",
87
"cffi>=1.11",
@@ -17,8 +16,9 @@ name = "suitesparse-graphblas"
1716
dynamic = ["version"]
1817
description = "SuiteSparse:GraphBLAS Python bindings."
1918
readme = "README.md"
20-
requires-python = ">=3.10"
21-
license = {file = "LICENSE"}
19+
requires-python = ">=3.11"
20+
license = "Apache-2.0"
21+
license-files = ["LICENSE"]
2222
authors = [
2323
{name = "Erik Welch", email = "erik.n.welch@gmail.com"},
2424
{name = "Jim Kitchen"},
@@ -47,13 +47,11 @@ keywords = [
4747
]
4848
classifiers = [
4949
"Development Status :: 5 - Production/Stable",
50-
"License :: OSI Approved :: Apache Software License",
5150
"Operating System :: MacOS :: MacOS X",
5251
"Operating System :: POSIX :: Linux",
5352
"Operating System :: Microsoft :: Windows",
5453
"Programming Language :: Python",
5554
"Programming Language :: Python :: 3",
56-
"Programming Language :: Python :: 3.10",
5755
"Programming Language :: Python :: 3.11",
5856
"Programming Language :: Python :: 3.12",
5957
"Programming Language :: Python :: 3.13",
@@ -70,7 +68,7 @@ classifiers = [
7068
]
7169
dependencies = [
7270
"cffi>=1.15",
73-
"numpy>=1.23",
71+
"numpy>=1.24",
7472
]
7573
[project.urls]
7674
homepage = "https://github.com/GraphBLAS/python-suitesparse-graphblas"
@@ -96,7 +94,7 @@ dirty_template = "{tag}+{ccount}.g{sha}.dirty"
9694

9795
[tool.black]
9896
line-length = 100
99-
target-version = ["py310", "py311", "py312", "py313", "py314"]
97+
target-version = ["py311", "py312", "py313", "py314"]
10098

10199
[tool.isort]
102100
sections = ["FUTURE", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"]

suitesparse.sh

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ elif [[ $1 =~ refs/tags/([0-9]*\.[0-9]*\.[0-9]*)\..*$ ]]; then
1010
VERSION=${BASH_REMATCH[1]}
1111
else
1212
echo "Specify a SuiteSparse version, such as: $0 refs/tags/7.4.3.0 (got: $1)"
13-
exit -1
13+
exit 1
1414
fi
15-
echo VERSION: $VERSION
15+
echo VERSION: "$VERSION"
1616

1717
NPROC="$(nproc)"
1818
if [ -z "${NPROC}" ]; then
@@ -27,7 +27,8 @@ if [ -n "${BREW_LIBOMP}" ]; then
2727
cmake_params+=(-DOpenMP_C_FLAGS="-Xclang -fopenmp -I$(brew --prefix libomp)/include")
2828
cmake_params+=(-DOpenMP_C_LIB_NAMES="libomp")
2929
cmake_params+=(-DOpenMP_libomp_LIBRARY="omp")
30-
export LDFLAGS="-L$(brew --prefix libomp)/lib"
30+
LDFLAGS="-L$(brew --prefix libomp)/lib"
31+
export LDFLAGS
3132

3233
if [ -n "${SUITESPARSE_MACOS_ARCH}" ]; then
3334
export CFLAGS="-arch ${SUITESPARSE_MACOS_ARCH}"
@@ -50,12 +51,13 @@ if [ -n "${GRAPHBLAS_PREFIX}" ]; then
5051
cmake_params+=(-DCMAKE_INSTALL_PREFIX="${GRAPHBLAS_PREFIX}")
5152
fi
5253

53-
curl -L https://github.com/DrTimothyAldenDavis/GraphBLAS/archive/refs/tags/v${VERSION}.tar.gz | tar xzf -
54-
cd GraphBLAS-${VERSION}/build
54+
curl -L "https://github.com/DrTimothyAldenDavis/GraphBLAS/archive/refs/tags/v${VERSION}.tar.gz" | tar xzf -
55+
cd "GraphBLAS-${VERSION}/build" || exit
5556

5657
# Disable optimizing some rarely-used types for significantly faster builds and significantly smaller wheel size.
5758
# Also the build with all types enabled sometimes stalls on GitHub Actions. Probably due to exceeded resource limits.
5859
# These can still be used, they'll just have reduced performance (AFAIK similar to UDTs).
60+
# shellcheck disable=SC2129
5961
# echo "#define GxB_NO_BOOL 1" >> ../Source/GB_control.h #
6062
# echo "#define GxB_NO_FP32 1" >> ../Source/GB_control.h #
6163
# echo "#define GxB_NO_FP64 1" >> ../Source/GB_control.h #
@@ -74,6 +76,7 @@ if [ -n "${SUITESPARSE_FAST_BUILD}" ]; then
7476
echo "suitesparse.sh: Fast build requested."
7577
# Disable optimizing even more types. This is for builds that don't finish in runner resource limits,
7678
# such as emulated aarm64.
79+
# shellcheck disable=SC2129
7780

7881
# echo "#define GxB_NO_BOOL 1" >> ../Source/GB_control.h
7982
# echo "#define GxB_NO_FP32 1" >> ../Source/GB_control.h
@@ -93,6 +96,7 @@ fi
9396
if [ -n "${SUITESPARSE_FASTEST_BUILD}" ]; then
9497
echo "suitesparse.sh: Fastest build requested."
9598
# Fastest build possible. For use in development and automated tests that do not depend on performance.
99+
# shellcheck disable=SC2129
96100

97101
echo "#define GxB_NO_BOOL 1" >> ../Source/GB_control.h
98102
echo "#define GxB_NO_FP32 1" >> ../Source/GB_control.h
@@ -137,7 +141,7 @@ else
137141
fi
138142

139143
cmake .. -DCMAKE_BUILD_TYPE=Release -G 'Unix Makefiles' "${cmake_params[@]}"
140-
make -j$NPROC
144+
make -j"$NPROC"
141145
$SUDO make install
142146

143147
if [ -n "${CMAKE_GNUtoMS}" ]; then

0 commit comments

Comments
 (0)