From 5d8df2e9ce4618da7a1b14f65e43a7ec88aaafbf Mon Sep 17 00:00:00 2001 From: Patrick Peglar Date: Tue, 14 Oct 2025 12:19:33 +0100 Subject: [PATCH 1/4] Require netcdf4 engine for xarray save in save equivalence tseting. --- .pre-commit-config.yaml | 4 ++-- tests/integration/test_xarray_load_and_save_equivalence.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 95e9779..f109aaa 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -33,7 +33,7 @@ repos: types_or: [asciidoc, python, markdown, rst] additional_dependencies: [tomli] -- repo: https://github.com/psf/black +- repo: https://github.com/psf/black-pre-commit-mirror rev: 25.9.0 hooks: - id: black @@ -47,7 +47,7 @@ repos: types: [file, python] - repo: https://github.com/pycqa/isort - rev: 6.0.1 + rev: 7.0.0 hooks: - id: isort types: [file, python] diff --git a/tests/integration/test_xarray_load_and_save_equivalence.py b/tests/integration/test_xarray_load_and_save_equivalence.py index a914813..56d61cc 100644 --- a/tests/integration/test_xarray_load_and_save_equivalence.py +++ b/tests/integration/test_xarray_load_and_save_equivalence.py @@ -8,11 +8,11 @@ import pytest import xarray + from ncdata.netcdf4 import from_nc4, to_nc4 from ncdata.threadlock_sharing import lockshare_context from ncdata.utils import dataset_differences from ncdata.xarray import from_xarray, to_xarray - from tests.data_testcase_schemas import ( BAD_LOADSAVE_TESTCASES, session_testdir, @@ -68,7 +68,7 @@ def test_save_direct_vs_viancdata(standard_testcase, tmp_path): # Re-save from Xarray temp_direct_savepath = tmp_path / "temp_save_xarray.nc" - xrds.to_netcdf(temp_direct_savepath) + xrds.to_netcdf(temp_direct_savepath, engine="netcdf4") # Save same, via ncdata temp_ncdata_savepath = tmp_path / "temp_save_xarray_via_ncdata.nc" ncds_fromxr = from_xarray(xrds) From 74093ee944b10abd882a7f3d4353438332b2af4c Mon Sep 17 00:00:00 2001 From: Patrick Peglar Date: Tue, 14 Oct 2025 14:17:12 +0100 Subject: [PATCH 2/4] Pin python, run tests with 3.12, 3.13. --- .github/workflows/ci-tests.yml | 5 +++-- requirements/readthedocs.yml | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml index a30842a..5e8baa0 100644 --- a/.github/workflows/ci-tests.yml +++ b/.github/workflows/ci-tests.yml @@ -20,12 +20,13 @@ on: jobs: tests: - name: "Test Python ${{ matrix.version }} session= ${{ matrix.session }}" + name: "Test session=${{ matrix.session }} Python=${{ matrix.python-version }}" runs-on: ubuntu-latest strategy: fail-fast: false matrix: session: ["tests", "doctests-docs", "doctests-api"] + python-version: ["3.12", "3.13"] defaults: run: shell: bash -l {0} @@ -42,7 +43,7 @@ jobs: with: miniforge-version: latest activate-environment: testenv - python-version: ${{ matrix.version }} + python-version: ${{ matrix.python-version }} channels: conda-forge show-channel-urls: true diff --git a/requirements/readthedocs.yml b/requirements/readthedocs.yml index 8c6e512..b7c80df 100644 --- a/requirements/readthedocs.yml +++ b/requirements/readthedocs.yml @@ -12,7 +12,7 @@ dependencies: - pip - pydata-sphinx-theme - pytest - - python<3.13 + - python<3.14 - sphinx - sphinxcontrib-napoleon - sphinx-copybutton From 856d50fc14db7ef352ece0cbd93026f1598a04ce Mon Sep 17 00:00:00 2001 From: Patrick Peglar Date: Tue, 14 Oct 2025 14:55:06 +0100 Subject: [PATCH 3/4] Update deps in pyproject.toml --- pyproject.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index a281d95..0c6ad77 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,7 +14,7 @@ authors = [ {name = "Patrick Peglar", email = "patrick.peglar@metoffice.gov.uk"}, ] description = "Abstract NetCDF data objects, providing fast data transfer between analysis packages." -requires-python = ">=3.7" +requires-python = ">=3.7, <3.14" keywords = [ "cf-metadata", "data-analysis", @@ -39,6 +39,7 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Topic :: Scientific/Engineering", ] dynamic = [ From eb7a800d274538ac855c9e2ddb5a2a9b68e45fd5 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 14 Oct 2025 13:55:27 +0000 Subject: [PATCH 4/4] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- tests/integration/test_xarray_load_and_save_equivalence.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration/test_xarray_load_and_save_equivalence.py b/tests/integration/test_xarray_load_and_save_equivalence.py index 56d61cc..fce4053 100644 --- a/tests/integration/test_xarray_load_and_save_equivalence.py +++ b/tests/integration/test_xarray_load_and_save_equivalence.py @@ -8,11 +8,11 @@ import pytest import xarray - from ncdata.netcdf4 import from_nc4, to_nc4 from ncdata.threadlock_sharing import lockshare_context from ncdata.utils import dataset_differences from ncdata.xarray import from_xarray, to_xarray + from tests.data_testcase_schemas import ( BAD_LOADSAVE_TESTCASES, session_testdir,