Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-gsw for openSUSE:Factory checked in at 2026-03-31 15:23:25 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-gsw (Old) and /work/SRC/openSUSE:Factory/.python-gsw.new.1999 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-gsw" Tue Mar 31 15:23:25 2026 rev:17 rq:1343872 version:3.6.21 Changes: -------- --- /work/SRC/openSUSE:Factory/python-gsw/python-gsw.changes 2025-09-29 16:38:28.046127957 +0200 +++ /work/SRC/openSUSE:Factory/.python-gsw.new.1999/python-gsw.changes 2026-03-31 15:24:50.258689550 +0200 @@ -1,0 +2,10 @@ +Tue Mar 31 09:19:32 UTC 2026 - Dirk Müller <[email protected]> + +- update to 3.6.21: + * Fix indentation + * Add geo_strf_steric_height function + * Removed deprecated macos-13 runner + * Implement ABI3 wheels + * Fix grid generation for geostrophic streamfunction + +------------------------------------------------------------------- Old: ---- v3.6.20.tar.gz New: ---- v3.6.21.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-gsw.spec ++++++ --- /var/tmp/diff_new_pack.zl8zeK/_old 2026-03-31 15:24:51.046722346 +0200 +++ /var/tmp/diff_new_pack.zl8zeK/_new 2026-03-31 15:24:51.050722512 +0200 @@ -1,7 +1,7 @@ # # spec file for package python-gsw # -# Copyright (c) 2025 SUSE LLC and contributors +# Copyright (c) 2026 SUSE LLC and contributors # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: python-gsw -Version: 3.6.20 +Version: 3.6.21 Release: 0 Summary: Gibbs Seawater Oceanographic Package of TEOS-10 # Note: Python code is MIT licensed @@ -27,14 +27,14 @@ URL: https://github.com/TEOS-10/GSW-python # gh#TEOS-10/GSW-Python#39 -- Tests are not included in the source tarball Source0: https://github.com/TEOS-10/GSW-Python/archive/v%{version}.tar.gz -BuildRequires: %{python_module devel >= 3.5} -BuildRequires: %{python_module numpy-devel} +BuildRequires: %{python_module devel >= 3.11} +BuildRequires: %{python_module numpy-devel >= 2.0} BuildRequires: %{python_module pip} -BuildRequires: %{python_module setuptools_scm} -BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module setuptools >= 42} +BuildRequires: %{python_module setuptools_scm >= 3.4} BuildRequires: %{python_module wheel} BuildRequires: fdupes -Requires: python-numpy +Requires: python-numpy >= 2.0 # SECTION tests BuildRequires: %{python_module pytest} BuildRequires: %{python_module pandas} ++++++ v3.6.20.tar.gz -> v3.6.21.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/GSW-Python-3.6.20/.github/dependabot.yml new/GSW-Python-3.6.21/.github/dependabot.yml --- old/GSW-Python-3.6.20/.github/dependabot.yml 2025-08-04 16:35:10.000000000 +0200 +++ new/GSW-Python-3.6.21/.github/dependabot.yml 2026-02-24 19:45:46.000000000 +0100 @@ -12,4 +12,6 @@ groups: github-actions: patterns: - - '*' \ No newline at end of file + - '*' + cooldown: + default-days: 7 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/GSW-Python-3.6.20/.github/workflows/cibuildwheel.yml new/GSW-Python-3.6.21/.github/workflows/cibuildwheel.yml --- old/GSW-Python-3.6.20/.github/workflows/cibuildwheel.yml 2025-08-04 16:35:10.000000000 +0200 +++ new/GSW-Python-3.6.21/.github/workflows/cibuildwheel.yml 2026-02-24 19:45:46.000000000 +0100 @@ -22,22 +22,22 @@ arch: aarch64 - os: windows-2022 arch: AMD64 - - os: macos-14 + - os: macos-15 arch: arm64 - - os: macos-13 + - os: macos-15-intel arch: x86_64 steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: fetch-depth: 0 persist-credentials: false - name: "Building ${{ matrix.os }} (${{ matrix.arch }}) wheels" - uses: pypa/cibuildwheel@ffd835cef18fa11522f608fc0fa973b89f5ddc87 # v3.1.0 + uses: pypa/cibuildwheel@298ed2fb2c105540f5ed055e8a6ad78d82dd3a7e # v3.3.1 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 @@ -46,7 +46,7 @@ python -c "import gsw; print(f'gsw v{gsw.__version__}')" && python -m pytest --pyargs gsw - - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 with: name: pypi-artifacts-${{ matrix.os }}-${{ matrix.arch }} path: ${{ github.workspace }}/wheelhouse/*.whl @@ -57,7 +57,7 @@ name: Build source distribution runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: fetch-depth: 0 persist-credentials: false @@ -69,7 +69,7 @@ && twine check dist/* && check-manifest --verbose - - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + - uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 with: name: pypi-artifacts path: ${{ github.workspace }}/dist/*.tar.gz @@ -81,7 +81,7 @@ name: "Show artifacts" runs-on: ubuntu-22.04 steps: - - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 + - uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 with: pattern: pypi-artifacts* path: ${{ github.workspace }}/dist @@ -100,14 +100,14 @@ # upload to PyPI for every tag starting with 'v' if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') steps: - - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 + - uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0 with: pattern: pypi-artifacts* path: ${{ github.workspace }}/dist merge-multiple: true - name: Publish package distributions to PyPI - uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4 + uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0 environment: name: release url: https://pypi.org/p/gsw diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/GSW-Python-3.6.20/.github/workflows/deploy-docs.yml new/GSW-Python-3.6.21/.github/workflows/deploy-docs.yml --- old/GSW-Python-3.6.20/.github/workflows/deploy-docs.yml 2025-08-04 16:35:10.000000000 +0200 +++ new/GSW-Python-3.6.21/.github/workflows/deploy-docs.yml 2026-02-24 19:45:46.000000000 +0100 @@ -11,18 +11,23 @@ run: shell: bash +# no permissions by default +permissions: {} + jobs: run: runs-on: ubuntu-latest + permissions: + contents: write steps: - name: checkout - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: fetch-depth: 0 persist-credentials: false - name: Set up Python - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 + uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: python-version: "3.x" @@ -44,5 +49,3 @@ with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: docs/_build/html - permissions: - actions: write diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/GSW-Python-3.6.20/.github/workflows/pre-commit.yml new/GSW-Python-3.6.21/.github/workflows/pre-commit.yml --- old/GSW-Python-3.6.20/.github/workflows/pre-commit.yml 2025-08-04 16:35:10.000000000 +0200 +++ new/GSW-Python-3.6.21/.github/workflows/pre-commit.yml 2026-02-24 19:45:46.000000000 +0100 @@ -9,11 +9,11 @@ pre-commit: runs-on: ubuntu-latest steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: fetch-depth: 0 persist-credentials: false - - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 + - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 - uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1 permissions: actions: none \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/GSW-Python-3.6.20/.github/workflows/test_code_generation.yml new/GSW-Python-3.6.21/.github/workflows/test_code_generation.yml --- old/GSW-Python-3.6.20/.github/workflows/test_code_generation.yml 2025-08-04 16:35:10.000000000 +0200 +++ new/GSW-Python-3.6.21/.github/workflows/test_code_generation.yml 2026-02-24 19:45:46.000000000 +0100 @@ -14,13 +14,13 @@ runs-on: ubuntu-latest steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: fetch-depth: 0 persist-credentials: false - name: Set up Python - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 + uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: python-version: "3.x" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/GSW-Python-3.6.20/.github/workflows/tests.yml new/GSW-Python-3.6.21/.github/workflows/tests.yml --- old/GSW-Python-3.6.20/.github/workflows/tests.yml 2025-08-04 16:35:10.000000000 +0200 +++ new/GSW-Python-3.6.21/.github/workflows/tests.yml 2026-02-24 19:45:46.000000000 +0100 @@ -14,23 +14,18 @@ runs-on: ${{ matrix.os }} strategy: matrix: - python-version: [ "3.9", "3.10", "3.11", "3.12" ] + python-version: [ "3.11", "3.12", "3.13", "3.14" ] os: [ windows-latest, ubuntu-latest, macos-latest ] - # https://scientific-python.org/specs/spec-0000/ - numpy-version: ["==1.24", ">=2"] - exclude: - - python-version: "3.12" - numpy-version: "==1.24" fail-fast: false steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: fetch-depth: 0 persist-credentials: false - name: Set up Python - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 + uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: python-version: ${{ matrix.python-version }} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/GSW-Python-3.6.20/.pre-commit-config.yaml new/GSW-Python-3.6.21/.pre-commit-config.yaml --- old/GSW-Python-3.6.20/.pre-commit-config.yaml 2025-08-04 16:35:10.000000000 +0200 +++ new/GSW-Python-3.6.21/.pre-commit-config.yaml 2026-02-24 19:45:46.000000000 +0100 @@ -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 @@ -17,21 +17,21 @@ gsw/tests/test_gibbs\.py )$ args: - - --ignore-words-list=nin,preformed,wih, + - --ignore-words-list=nin,preformed,wih,pres, - 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.11.13 + rev: v0.14.11 hooks: - id: ruff - repo: https://github.com/woodruffw/zizmor-pre-commit - rev: v1.9.0 + rev: v1.20.0 hooks: - id: zizmor diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/GSW-Python-3.6.20/gsw/geostrophy.py new/GSW-Python-3.6.21/gsw/geostrophy.py --- old/GSW-Python-3.6.20/gsw/geostrophy.py 2025-08-04 16:35:10.000000000 +0200 +++ new/GSW-Python-3.6.21/gsw/geostrophy.py 2026-02-24 19:45:46.000000000 +0100 @@ -9,6 +9,7 @@ from .conversions import z_from_p __all__ = ['geo_strf_dyn_height', + 'geo_strf_steric_height', 'distance', 'f', 'geostrophic_velocity', @@ -105,6 +106,52 @@ return dh +@match_args_return +def geo_strf_steric_height(SA, CT, p, p_ref=0, axis=0, max_dp=1.0, interp_method="pchip"): + """ + Steric height anomaly as a function of pressure. + + Parameters + ---------- + SA : array-like + Absolute Salinity, g/kg + CT : array-like + Conservative Temperature (ITS-90), degrees C + p : array-like + Sea pressure (absolute pressure minus 10.1325 dbar), dbar + p_ref : float or array-like, optional + Reference pressure, dbar + axis : int, optional, default is 0 + The index of the pressure dimension in SA and CT. + max_dp : float + If any pressure interval in the input p exceeds max_dp, the dynamic + height will be calculated after interpolating to a grid with this + spacing. + interp_method : string {'mrst', 'pchip', 'linear'} + Interpolation algorithm. + + Returns + ------- + steric_height : array + This is the integral of specific volume anomaly with respect + to pressure, from each pressure in p to the specified + reference pressure, divided by the global mean surface value of + gravitational acceleration, 9.7963 m s^-2. (see page 46 of Griffies, 2004) + It is not exactly the height of an isobaric surface above a + geopotential surface, but is an exact geostrophic streamfunction. + + References + ---------- + Griffies, S. M., 2004: Fundamentals of Ocean Climate Models. Princeton, + NJ: Princeton University Press, 518 pp + xxxiv. + + """ + return ( + geo_strf_dyn_height(SA, CT, p, p_ref, axis=axis, max_dp=max_dp, interp_method=interp_method) + / 9.7963 + ) + + def unwrap(lon, centered=True, copy=True): """ Unwrap a sequence of longitudes or headings in degrees. Binary files old/GSW-Python-3.6.20/gsw/tests/geo_strf_steric_height.npy and new/GSW-Python-3.6.21/gsw/tests/geo_strf_steric_height.npy differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/GSW-Python-3.6.20/gsw/tests/test_check_functions.py new/GSW-Python-3.6.21/gsw/tests/test_check_functions.py --- old/GSW-Python-3.6.20/gsw/tests/test_check_functions.py 2025-08-04 16:35:10.000000000 +0200 +++ new/GSW-Python-3.6.21/gsw/tests/test_check_functions.py 2026-02-24 19:45:46.000000000 +0100 @@ -33,6 +33,7 @@ # Substitute new check values for the pchip interpolation version. cv.geo_strf_dyn_height = np.load(os.path.join(root_path,'geo_strf_dyn_height.npy')) +cv.geo_strf_steric_height = np.load(os.path.join(root_path,'geo_strf_steric_height.npy')) cv.geo_strf_velocity = np.load(os.path.join(root_path,'geo_strf_velocity.npy')) cf = Bunch() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/GSW-Python-3.6.20/gsw/tests/test_geostrophy.py new/GSW-Python-3.6.21/gsw/tests/test_geostrophy.py --- old/GSW-Python-3.6.20/gsw/tests/test_geostrophy.py 2025-08-04 16:35:10.000000000 +0200 +++ new/GSW-Python-3.6.21/gsw/tests/test_geostrophy.py 2026-02-24 19:45:46.000000000 +0100 @@ -90,6 +90,21 @@ expected = strf0[1:] - strf0[1] assert_almost_equal(found, expected) +def test_dyn_height_grid_bug(): + """ + The C toolbox had a bug in the interpolation grid generation, triggered + under specific circumstances demonstrated in issue #225. The fix was copied + from https://github.com/TEOS-10/GSW-C/pull/87. + """ + SA = np.array([34.17634373, 34.17633109, 34.17725485, 34.90704565]) + CT = np.array([ 0.02005831, 0.02003146, 0.01868686, 1.7676452 ]) + pres = np.array([ 4.9000001 , 5.69999981, 15.80000019, 995.90002441]) + # Last 2 args: grid delta-p is 1; interp method is 3 (mrst). + dh1 = gsw._gsw_ufuncs.geo_strf_dyn_height_1(SA, CT, pres, pres[-1], 1, 3) + assert dh1[-1] == 0 + dh2 = gsw.geo_strf_dyn_height(SA, CT, pres, p_ref = pres[-1], interp_method="mrst") + assert_array_equal(dh1, dh2) + def test_pz_roundtrip(): """ The p_z conversion functions have Matlab-based checks that use @@ -113,3 +128,15 @@ strf = gsw.geo_strf_dyn_height(SA, CT, p, p_ref=pr, interp_method='mrst') assert_allclose(strf, cv.geo_strf_dyn_height, rtol=0, atol=cv.geo_strf_dyn_height_ca) + +def test_steric_height_mrst(): + """ + Tests the MRST-PCHIP interpolation method. + """ + p = cv.p_chck_cast + CT = cv.CT_chck_cast + SA = cv.SA_chck_cast + pr = cv.pr + strf = gsw.geo_strf_steric_height(SA, CT, p, p_ref=pr, interp_method='mrst') + + assert_allclose(strf, cv.geo_strf_steric_height, rtol=0, atol=cv.geo_strf_steric_height_ca) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/GSW-Python-3.6.20/gsw/tests/test_xarray.py new/GSW-Python-3.6.21/gsw/tests/test_xarray.py --- old/GSW-Python-3.6.20/gsw/tests/test_xarray.py 2025-08-04 16:35:10.000000000 +0200 +++ new/GSW-Python-3.6.21/gsw/tests/test_xarray.py 2026-02-24 19:45:46.000000000 +0100 @@ -42,6 +42,7 @@ # Substitute new check values for the pchip interpolation version. cv.geo_strf_dyn_height = np.load(os.path.join(root_path,'geo_strf_dyn_height.npy')) +cv.geo_strf_steric_height = np.load(os.path.join(root_path,'geo_strf_steric_height.npy')) cv.geo_strf_velocity = np.load(os.path.join(root_path,'geo_strf_velocity.npy')) for name in ['SA_chck_cast', 't_chck_cast', 'p_chck_cast']: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/GSW-Python-3.6.20/gsw/tests/write_geo_npyfiles.py new/GSW-Python-3.6.21/gsw/tests/write_geo_npyfiles.py --- old/GSW-Python-3.6.20/gsw/tests/write_geo_npyfiles.py 2025-08-04 16:35:10.000000000 +0200 +++ new/GSW-Python-3.6.21/gsw/tests/write_geo_npyfiles.py 2026-02-24 19:45:46.000000000 +0100 @@ -25,6 +25,12 @@ cv.pr) np.save('geo_strf_dyn_height.npy', dyn_height) +steric_height = gsw.geo_strf_steric_height(cv.SA_chck_cast, + cv.CT_chck_cast, + cv.p_chck_cast, + cv.pr) +np.save('geo_strf_steric_height.npy', steric_height) + lon = cv.long_chck_cast lat = cv.lat_chck_cast p = cv.p_chck_cast diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/GSW-Python-3.6.20/pyproject.toml new/GSW-Python-3.6.21/pyproject.toml --- old/GSW-Python-3.6.20/pyproject.toml 2025-08-04 16:35:10.000000000 +0200 +++ new/GSW-Python-3.6.21/pyproject.toml 2026-02-24 19:45:46.000000000 +0100 @@ -2,8 +2,7 @@ build-backend = "setuptools.build_meta" requires = [ "build", - "numpy>=2.0.0rc1,<3; python_version>='3.9'", - "oldest-supported-numpy; python_version<'3.9'", + "numpy>=2,<3", "pip>9.0.1", "setuptools>=42", "setuptools-scm[toml]>=3.4", @@ -13,24 +12,22 @@ [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 = "[email protected]" }, ] -requires-python = ">=3.8" +requires-python = ">=3.11" 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 = [ @@ -38,14 +35,13 @@ "version", ] dependencies = [ - "numpy>=1.21", + "numpy>=2", ] urls.documentation = "https://teos-10.github.io/GSW-Python/" 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" ] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/GSW-Python-3.6.20/setup.py new/GSW-Python-3.6.21/setup.py --- old/GSW-Python-3.6.20/setup.py 2025-08-04 16:35:10.000000000 +0200 +++ new/GSW-Python-3.6.21/setup.py 2026-02-24 19:45:46.000000000 +0100 @@ -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 @@ ] 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) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/GSW-Python-3.6.20/src/c_gsw/gsw_oceanographic_toolbox.c new/GSW-Python-3.6.21/src/c_gsw/gsw_oceanographic_toolbox.c --- old/GSW-Python-3.6.20/src/c_gsw/gsw_oceanographic_toolbox.c 2025-08-04 16:35:10.000000000 +0200 +++ new/GSW-Python-3.6.21/src/c_gsw/gsw_oceanographic_toolbox.c 2026-02-24 19:45:46.000000000 +0100 @@ -4057,7 +4057,7 @@ Its return argument is the number of elements used in p_i, or -1 on error. */ -static int refine_grid_for_dh(double *p, double p_ref, int nz, +int refine_grid_for_dh(double *p, double p_ref, int nz, double dp, double *p_i, int ni_max, /* size of p_i array; larger than needed */ int *p_indices, int *p_ref_ind_ptr) @@ -4094,10 +4094,16 @@ /* We did not insert p_ref, so insert either p_next or p[iorig]. */ if (p_next < p[iorig] - p_tol) { p_i[i] = p_next; + if (p_ref == p_next) { + *p_ref_ind_ptr = i; + } iuniform++; } else { p_i[i] = p[iorig]; + if (p_ref == p[iorig]) { + *p_ref_ind_ptr = i; + } p_indices[iorig] = i; /* Skip this p_next if it is close to the point we just added. */ if (p_next < p[iorig] + p_tol) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/GSW-Python-3.6.20/src/c_gsw/gswteos-10.h new/GSW-Python-3.6.21/src/c_gsw/gswteos-10.h --- old/GSW-Python-3.6.20/src/c_gsw/gswteos-10.h 2025-08-04 16:35:10.000000000 +0200 +++ new/GSW-Python-3.6.21/src/c_gsw/gswteos-10.h 2026-02-24 19:45:46.000000000 +0100 @@ -318,6 +318,8 @@ double sea_surface_geopotential); DECLSPEC extern double gsw_p_from_z(double z, double lat, double geo_strf_dyn_height, double sea_surface_geopotential); +DECLSPEC extern int refine_grid_for_dh(double *p, double p_ref, int nz, + double dp, double *p_i, int ni_max, int *p_indices, int *p_ref_ind_ptr); #ifdef __cplusplus } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/GSW-Python-3.6.20/src/method_bodies.c new/GSW-Python-3.6.21/src/method_bodies.c --- old/GSW-Python-3.6.20/src/method_bodies.c 2025-08-04 16:35:10.000000000 +0200 +++ new/GSW-Python-3.6.21/src/method_bodies.c 2026-02-24 19:45:46.000000000 +0100 @@ -26,14 +26,14 @@ 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 @@ { 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 @@ 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; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/GSW-Python-3.6.20/tools/c_header_parser.py new/GSW-Python-3.6.21/tools/c_header_parser.py --- old/GSW-Python-3.6.20/tools/c_header_parser.py 2025-08-04 16:35:10.000000000 +0200 +++ new/GSW-Python-3.6.21/tools/c_header_parser.py 2026-02-24 19:45:46.000000000 +0100 @@ -59,7 +59,11 @@ argtypes.append(parts[0] + parts[1]) argnames.append(parts[2]) - retgroups = retpat.match(sig).groups() + try: + retgroups = retpat.match(sig).groups() + except AttributeError: + # For example, name doesn't start with "gsw_". + return None ret = retgroups[0] + retgroups[1] funcname = retgroups[2] @@ -80,7 +84,8 @@ sigdict = {} for sig in sigs: psig = parse_signature(sig) - sigdict[psig['name']] = psig + if psig is not None: + sigdict[psig['name']] = psig return sigdict def get_sigdict(srcdir="src"):
