From 98a30091349a21547c8c696d593e537cb5d06979 Mon Sep 17 00:00:00 2001 From: "Sadie L. Bartholomew" Date: Mon, 21 Jul 2025 17:51:08 +0100 Subject: [PATCH 1/7] Add distributed pin on v.2025.5.1 to requirements --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index 1bfcaec175..297589f029 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,5 +5,6 @@ cfdm>=1.12.2.0, <1.12.3.0 psutil>=0.6.0 cfunits>=3.3.7 dask>=2025.5.1 +distributed>=2025.5.1 packaging>=20.0 scipy>=1.10.0 From f72580335ddd1f35bad775483d2f2f02bf9eda5f Mon Sep 17 00:00:00 2001 From: "Sadie L. Bartholomew" Date: Mon, 21 Jul 2025 18:06:27 +0100 Subject: [PATCH 2/7] Add check for suitable importable distributed module --- cf/__init__.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/cf/__init__.py b/cf/__init__.py index 74aaa73f89..ed2ad4a37e 100644 --- a/cf/__init__.py +++ b/cf/__init__.py @@ -209,6 +209,18 @@ f"Got {dask.__version__} at {dask.__file__}" ) +try: + import distributed +except ImportError as error1: + raise ImportError(_error0 + str(error1)) +else: + _minimum_vn = "2025.5.1" + if Version(distributed.__version__) < Version(_minimum_vn): + raise ValueError( + f"Bad distributed version: cf requires distributed>={_minimum_vn}. " + f"Got {distributed.__version__} at {distributed.__file__}" + ) + try: import scipy except ImportError as error1: From 377a476e66552b4e130180ac21d270fb50b2fdc5 Mon Sep 17 00:00:00 2001 From: "Sadie L. Bartholomew" Date: Mon, 21 Jul 2025 18:09:58 +0100 Subject: [PATCH 3/7] Lint to apply line wrapping (one character over limit) --- cf/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cf/__init__.py b/cf/__init__.py index ed2ad4a37e..97a24eadd6 100644 --- a/cf/__init__.py +++ b/cf/__init__.py @@ -217,7 +217,8 @@ _minimum_vn = "2025.5.1" if Version(distributed.__version__) < Version(_minimum_vn): raise ValueError( - f"Bad distributed version: cf requires distributed>={_minimum_vn}. " + "Bad distributed version: cf requires " + f"distributed>={_minimum_vn}. " f"Got {distributed.__version__} at {distributed.__file__}" ) From 5d87878b348fd03cc7cfede10a70c42894b97b56 Mon Sep 17 00:00:00 2001 From: "Sadie L. Bartholomew" Date: Mon, 21 Jul 2025 18:16:29 +0100 Subject: [PATCH 4/7] Update cf.environment example for new addition, distributed --- cf/functions.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cf/functions.py b/cf/functions.py index 82799009ec..3bfdcb3a60 100644 --- a/cf/functions.py +++ b/cf/functions.py @@ -3171,6 +3171,7 @@ def environment(display=True, paths=True): s3fs: 2024.12.0 /home/miniconda3/lib/python3.12/site-packages/s3fs/__init__.py scipy: 1.15.1 /home/miniconda3/lib/python3.12/site-packages/scipy/__init__.py dask: 2025.5.1 /home/miniconda3/lib/python3.12/site-packages/dask/__init__.py + distributed: 2025.5.1 /home/miniconda3/lib/python3.12/site-packages/distributed/__init__.py cftime: 1.6.4.post1 /home/miniconda3/lib/python3.12/site-packages/cftime/__init__.py cfunits: 3.3.7 /home/miniconda3/lib/python3.12/site-packages/cfunits/__init__.py cfdm: 1.12.2.0 /home/miniconda3/lib/python3.12/site-packages/cfdm/__init__.py @@ -3196,6 +3197,7 @@ def environment(display=True, paths=True): s3fs: 2024.12.0 scipy: 1.15.1 dask: 2025.5.1 + distributed: 2025.5.1 cftime: 1.6.4.post1 cfunits: 3.3.7 cfdm: 1.12.2.0 From bf04c40ee2eb7878b17127e8720a62d4d57e4f5c Mon Sep 17 00:00:00 2001 From: "Sadie L. Bartholomew" Date: Mon, 21 Jul 2025 18:31:44 +0100 Subject: [PATCH 5/7] Docs: add distrbiuted to installation page requires list --- docs/source/installation.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/source/installation.rst b/docs/source/installation.rst index e9e6cf2e15..5be7015d87 100644 --- a/docs/source/installation.rst +++ b/docs/source/installation.rst @@ -196,6 +196,8 @@ Required * `dask `_, version 2025.5.1. +* `distributed `_, version 2025.5.1. + * `netCDF4 `_, 1.7.2 or newer. * `cftime `_, version 1.6.4 or newer From 6ee5d52235321172df0db966d163c703b7a56dce Mon Sep 17 00:00:00 2001 From: "Sadie L. Bartholomew" Date: Mon, 21 Jul 2025 18:34:39 +0100 Subject: [PATCH 6/7] Docs: clarify validity of newer vers of dask & distributed --- docs/source/installation.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/source/installation.rst b/docs/source/installation.rst index 5be7015d87..fc58d8664a 100644 --- a/docs/source/installation.rst +++ b/docs/source/installation.rst @@ -194,9 +194,10 @@ Required * `numpy `_, versions 2.0.0 or newer. -* `dask `_, version 2025.5.1. +* `dask `_, version 2025.5.1 or newer. -* `distributed `_, version 2025.5.1. +* `distributed `_, version 2025.5.1 or + newer. * `netCDF4 `_, 1.7.2 or newer. From 9993f68b8183a86ed27dc09a873cc58a27940a9b Mon Sep 17 00:00:00 2001 From: "Sadie L. Bartholomew" Date: Mon, 21 Jul 2025 18:35:54 +0100 Subject: [PATCH 7/7] Update changelog for new dependency --- Changelog.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/Changelog.rst b/Changelog.rst index 2bee5eaa55..5b3e8d907c 100644 --- a/Changelog.rst +++ b/Changelog.rst @@ -6,6 +6,7 @@ Version NEXTVERSION * New methods to allow changing units in a chain: `cf.Field.to_units`, `cf.Data.to_units` (https://github.com/NCAS-CMS/cf-python/issues/874) +* New dependency: ``distributed>=2025.5.1`` ----