From 831a30a6375fc745e0f7a8eb28a0cd37b35066a6 Mon Sep 17 00:00:00 2001 From: Filipe Fernandes Date: Wed, 26 Nov 2025 15:40:33 -0300 Subject: [PATCH 1/5] test ABI3 --- .github/workflows/cibuildwheel.yml | 4 ++-- setup.py | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml index 5af635e..251c0d0 100644 --- a/.github/workflows/cibuildwheel.yml +++ b/.github/workflows/cibuildwheel.yml @@ -36,8 +36,8 @@ jobs: - name: "Building ${{ matrix.os }} (${{ matrix.arch }}) wheels" uses: pypa/cibuildwheel@63fd63b352a9a8bdcc24791c9dbee952ee9a8abc # v3.3.0 env: - # Skips pypy and musllinux for now. - CIBW_SKIP: "pp* cp36-* cp37-* cp38-* *-musllinux*" + CIBW_SKIP: "*-musllinux*" + CIBW_BUILD: "cp311-* cp314-*" CIBW_ARCHS: ${{ matrix.arch }} CIBW_BUILD_FRONTEND: build CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28 diff --git a/setup.py b/setup.py index 4e08805..7effa8d 100644 --- a/setup.py +++ b/setup.py @@ -14,6 +14,13 @@ rootpath = os.path.abspath(os.path.dirname(__file__)) +DEFINE_MACROS = [ + ("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION"), + # 0x030B0000 -> 3.11 + ("Py_LIMITED_API", "0x030B0000"), + ("CYTHON_LIMITED_API", None), +] + def read(*parts): return open(os.path.join(rootpath, *parts)).read() @@ -49,9 +56,15 @@ def build_extensions(self): ] config = { - "ext_modules": [Extension("gsw._gsw_ufuncs", ufunc_src_list)], + "ext_modules": [ + Extension( + "gsw._gsw_ufuncs", + ufunc_src_list, + define_macros=DEFINE_MACROS, + py_limited_api=True)], "include_dirs": [os.path.join(rootpath, "src", "c_gsw")], "cmdclass": {"build_ext": build_ext}, + "options": {"bdist_wheel": {"py_limited_api": "cp311"}}, } setup(**config) From c3d85e0a19345cba8ce7f213bf09576db1a138db Mon Sep 17 00:00:00 2001 From: Filipe Fernandes Date: Wed, 26 Nov 2025 15:46:31 -0300 Subject: [PATCH 2/5] add cooldown --- .github/dependabot.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 204a481..c7e158d 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -12,4 +12,6 @@ updates: groups: github-actions: patterns: - - '*' \ No newline at end of file + - '*' + cooldown: + default-days: 4 \ No newline at end of file From b84ee1396b8d7b91f95be549e253ca03a32b7de4 Mon Sep 17 00:00:00 2001 From: Filipe Fernandes Date: Wed, 26 Nov 2025 15:46:40 -0300 Subject: [PATCH 3/5] update --- .pre-commit-config.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 33f58c7..a13eaf1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v5.0.0 + rev: v6.0.0 hooks: - id: check-ast - id: debug-statements @@ -20,18 +20,18 @@ repos: - --ignore-words-list=nin,preformed,wih, - repo: https://github.com/tox-dev/pyproject-fmt - rev: v2.6.0 + rev: v2.11.1 hooks: - id: pyproject-fmt - repo: https://github.com/charliermarsh/ruff-pre-commit - rev: v0.12.7 + rev: v0.14.6 hooks: - id: ruff - repo: https://github.com/woodruffw/zizmor-pre-commit - rev: v1.11.0 + rev: v1.17.0 hooks: - id: zizmor From cbfe9ef7ea1cf2cc91d3d261c67bf197afe9b500 Mon Sep 17 00:00:00 2001 From: Filipe Fernandes Date: Wed, 26 Nov 2025 15:47:00 -0300 Subject: [PATCH 4/5] minor fixes and updates --- pyproject.toml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 74f321c..b4d4bc5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,24 +13,24 @@ requires = [ [project] name = "gsw" description = "Gibbs Seawater Oceanographic Package of TEOS-10" -license = { text = "BSD-3-Clause" } +license = "BSD-3-Clause" +license-files = [ "LICENSE.txt" ] authors = [ { name = "Eric Firing, Filipe Fernandes", email = "efiring@hawaii.edu" }, ] -requires-python = ">=3.8" +requires-python = ">=3.9" classifiers = [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Science/Research", - "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", "Topic :: Scientific/Engineering", ] dynamic = [ @@ -45,7 +45,6 @@ urls.homepage = "https://www.teos-10.org/" urls.repository = "https://github.com/TEOS-10/GSW-python" [tool.setuptools] -license-files = [ "LICENSE.txt" ] zip-safe = false include-package-data = true packages = [ "gsw", "gsw.tests" ] From f3b2f907de38c158a4b7c54b25bc90a7d4ba59fe Mon Sep 17 00:00:00 2001 From: Filipe Fernandes Date: Wed, 26 Nov 2025 16:33:17 -0300 Subject: [PATCH 5/5] not sure if this is the best fix --- src/method_bodies.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/method_bodies.c b/src/method_bodies.c index c4bf92b..0dec31f 100644 --- a/src/method_bodies.c +++ b/src/method_bodies.c @@ -26,14 +26,14 @@ geo_strf_dyn_height(PyObject *NPY_UNUSED(self), PyObject *args) ct_a = (PyArrayObject *)PyArray_ContiguousFromAny(ct_o, NPY_DOUBLE, 1, 1); if (ct_a == NULL) { - Py_XDECREF(sa_a); + Py_XDECREF((PyObject *)sa_a); return NULL; } p_a = (PyArrayObject *)PyArray_ContiguousFromAny(p_o, NPY_DOUBLE, 1, 1); if (p_a == NULL) { - Py_XDECREF(sa_a); - Py_XDECREF(ct_a); + Py_XDECREF((PyObject *)sa_a); + Py_XDECREF((PyObject *)ct_a); return NULL; } n_levels = PyArray_DIM(sa_a, 0); @@ -41,17 +41,17 @@ geo_strf_dyn_height(PyObject *NPY_UNUSED(self), PyObject *args) { PyErr_SetString(PyExc_ValueError, "Arguments SA, CT, and p must have the same dimensions."); - Py_XDECREF(sa_a); - Py_XDECREF(ct_a); - Py_XDECREF(p_a); + Py_XDECREF((PyObject *)sa_a); + Py_XDECREF((PyObject *)ct_a); + Py_XDECREF((PyObject *)p_a); return NULL; } dh_a = (PyArrayObject *)PyArray_NewLikeArray(sa_a, NPY_CORDER, NULL, 0); if (dh_a == NULL) { - Py_XDECREF(sa_a); - Py_XDECREF(ct_a); - Py_XDECREF(p_a); + Py_XDECREF((PyObject *)sa_a); + Py_XDECREF((PyObject *)ct_a); + Py_XDECREF((PyObject *)p_a); return NULL; } ret = gsw_geo_strf_dyn_height((double *)PyArray_DATA(sa_a), @@ -60,15 +60,15 @@ geo_strf_dyn_height(PyObject *NPY_UNUSED(self), PyObject *args) p_ref, n_levels, (double *)PyArray_DATA(dh_a)); - Py_XDECREF(sa_a); - Py_XDECREF(ct_a); - Py_XDECREF(p_a); + Py_XDECREF((PyObject *)sa_a); + Py_XDECREF((PyObject *)ct_a); + Py_XDECREF((PyObject *)p_a); if (ret == NULL) { PyErr_SetString(PyExc_RuntimeError, "gws_geo_strf_dyn_height failed; check input arguments"); - Py_XDECREF(dh_a); + Py_XDECREF((PyObject *)dh_a); return NULL; } return (PyObject *)dh_a;