Skip to content

Commit 1abec15

Browse files
committed
Support Python 3.14 (and drop Python 3.9)
1 parent 4e49ec4 commit 1abec15

File tree

6 files changed

+30
-20
lines changed

6 files changed

+30
-20
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
source: ["conda-forge"]
1919
# os: ["ubuntu-latest"]
2020
# source: ["source"]
21-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
21+
python-version: [ "3.10", "3.11", "3.12", "3.13", "3.14"]
2222
steps:
2323
- name: Checkout
2424
uses: actions/checkout@v4

.pre-commit-config.yaml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ repos:
2828
- id: mixed-line-ending
2929
args: [--fix=lf]
3030
- id: trailing-whitespace
31+
- id: name-tests-test
32+
args: ["--pytest-test-first"]
3133
- repo: https://github.com/abravalheri/validate-pyproject
3234
rev: v0.24.1
3335
hooks:
@@ -39,16 +41,16 @@ repos:
3941
- id: autoflake
4042
args: [--in-place]
4143
- repo: https://github.com/pycqa/isort
42-
rev: 6.0.1
44+
rev: 7.0.0
4345
hooks:
4446
- id: isort
4547
- repo: https://github.com/asottile/pyupgrade
46-
rev: v3.20.0
48+
rev: v3.21.0
4749
hooks:
4850
- id: pyupgrade
49-
args: [--py39-plus]
51+
args: [--py310-plus]
5052
- repo: https://github.com/psf/black-pre-commit-mirror
51-
rev: 25.1.0
53+
rev: 25.9.0
5254
hooks:
5355
- id: black
5456
- repo: https://github.com/PyCQA/flake8
@@ -61,21 +63,21 @@ repos:
6163
- flake8==7.3.0
6264
- flake8-comprehensions==3.17.0
6365
- flake8-bugbear==24.12.12
64-
# - flake8-simplify==0.21.0
66+
# - flake8-simplify==0.22.0
6567
- repo: https://github.com/asottile/yesqa
6668
rev: v1.5.0
6769
hooks:
6870
- id: yesqa
6971
additional_dependencies: *flake8_dependencies
7072
# `pyroma` may help keep our package standards up to date if best practices change.
7173
# This is a "low value" check though and too slow to run as part of pre-commit.
72-
# - repo: https://github.com/regebro/pyroma
73-
# rev: "4.2"
74-
# hooks:
75-
# - id: pyroma
76-
# args: [-n, "10", .]
74+
- repo: https://github.com/regebro/pyroma
75+
rev: "5.0"
76+
hooks:
77+
- id: pyroma
78+
args: [-n, "10", .]
7779
- repo: https://github.com/python-jsonschema/check-jsonschema
78-
rev: 0.33.3
80+
rev: 0.34.1
7981
hooks:
8082
- id: check-dependabot
8183
- id: check-github-workflows

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG BASE_CONTAINER=python:3.9-slim-buster
1+
ARG BASE_CONTAINER=python:3.10-slim-buster
22
FROM ${BASE_CONTAINER} as suitesparse
33
ENV DEBIAN_FRONTEND=noninteractive
44

@@ -24,7 +24,7 @@ ENV PYTHONUNBUFFERED 1
2424

2525
COPY --from=suitesparse /usr/include/GraphBLAS.h /usr/local/include/
2626
COPY --from=suitesparse /usr/lib/x86_64-linux-gnu/libgraphblas* /usr/lib/x86_64-linux-gnu/
27-
COPY --from=suitesparse /build/pycparser/utils/fake_libc_include/* /usr/local/lib/python3.9/site-packages/pycparser/utils/fake_libc_include/
27+
COPY --from=suitesparse /build/pycparser/utils/fake_libc_include/* /usr/local/lib/python3.10/site-packages/pycparser/utils/fake_libc_include/
2828

2929
RUN apt-get update && apt-get install -yq build-essential git
3030
RUN pip3 install numpy cffi pytest cython
@@ -44,4 +44,4 @@ RUN apt-get -y --purge remove git python3-pip && apt-get clean
4444
FROM ${BASE_CONTAINER}
4545
COPY --from=suitesparse /usr/lib/x86_64-linux-gnu/libgraphblas* /usr/lib/x86_64-linux-gnu/
4646
COPY --from=suitesparse /usr/lib/x86_64-linux-gnu/libgomp* /usr/lib/x86_64-linux-gnu/
47-
COPY --from=psg /usr/local/lib/python3.9/site-packages /usr/local/lib/python3.9/site-packages
47+
COPY --from=psg /usr/local/lib/python3.10/site-packages /usr/local/lib/python3.10/site-packages

build_graphblas_cffi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# GraphBLAS_ROOT env var can point to the root directory of GraphBLAS to link against.
1414
# Expected subdirectories: include/ (contains GraphBLAS.h), lib/, and bin/ (on Windows only)
1515
# Otherwise fallback to default system folders.
16-
graphblas_root = os.environ.get("GraphBLAS_ROOT", None)
16+
graphblas_root = os.environ.get("GraphBLAS_ROOT")
1717

1818
if not graphblas_root:
1919
# Windows wheels.yml configures suitesparse.sh to install GraphBLAS to "C:\\GraphBLAS".

pyproject.toml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ requires = [
66
"setuptools-git-versioning",
77
"wheel",
88
"cffi>=1.11",
9-
"cython",
9+
"cython; python_version<'3.14'",
10+
"cython>=3.1; python_version>='3.14'",
1011
"numpy>=2.0",
1112
]
1213

@@ -15,7 +16,7 @@ name = "suitesparse-graphblas"
1516
dynamic = ["version"]
1617
description = "SuiteSparse:GraphBLAS Python bindings."
1718
readme = "README.md"
18-
requires-python = ">=3.9"
19+
requires-python = ">=3.10"
1920
license = {file = "LICENSE"}
2021
authors = [
2122
{name = "Erik Welch", email = "[email protected]"},
@@ -51,12 +52,13 @@ classifiers = [
5152
"Operating System :: Microsoft :: Windows",
5253
"Programming Language :: Python",
5354
"Programming Language :: Python :: 3",
54-
"Programming Language :: Python :: 3.9",
5555
"Programming Language :: Python :: 3.10",
5656
"Programming Language :: Python :: 3.11",
5757
"Programming Language :: Python :: 3.12",
5858
"Programming Language :: Python :: 3.13",
59+
"Programming Language :: Python :: 3.14",
5960
"Programming Language :: Python :: 3 :: Only",
61+
"Programming Language :: Python :: Free Threading :: 2 - Beta",
6062
"Intended Audience :: Developers",
6163
"Intended Audience :: Other Audience",
6264
"Intended Audience :: Science/Research",
@@ -93,7 +95,7 @@ dirty_template = "{tag}+{ccount}.g{sha}.dirty"
9395

9496
[tool.black]
9597
line-length = 100
96-
target-version = ["py39", "py310", "py311", "py312", "py313"]
98+
target-version = ["py310", "py311", "py312", "py313", "py314"]
9799

98100
[tool.isort]
99101
sections = ["FUTURE", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"]

suitesparse_graphblas/utils.pyx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# cython: freethreading_compatible=True
2+
#
3+
# We don't do anything special to support free-threading, but GraphBLAS C
4+
# libraries are required to be thread-safe, so things should "just work".
5+
# Of course, users writing multithreaded code can find many creative ways
6+
# to fail, but python-suitesparse-graphblas shouldn't crash.
17
import numpy as np
28
from cpython.ref cimport Py_INCREF
39
from libc.stdint cimport uintptr_t

0 commit comments

Comments
 (0)