From 1a96ee97550fb60d1e8685d9cf2ad10e5ab241d6 Mon Sep 17 00:00:00 2001 From: stubbiali Date: Thu, 31 Aug 2023 00:05:01 +0200 Subject: [PATCH 01/19] Update build requirements. --- pyproject.toml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 01562cefb..3e3376605 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,9 @@ [build-system] requires = [ - "Cython>=0.29", + "Cython==0.29.36", + "mpi4py>=3.1", "oldest-supported-numpy", - "setuptools>=61", + "setuptools>=65.5.0", ] build-backend = "setuptools.build_meta" From de11aa698494fb0cbaef1f10f2fc31aa518cdbb1 Mon Sep 17 00:00:00 2001 From: stubbiali Date: Thu, 31 Aug 2023 10:36:40 +0200 Subject: [PATCH 02/19] Relax constraint on cython. --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 3e3376605..8b2bd8629 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] requires = [ - "Cython==0.29.36", + "Cython>=0.29", "mpi4py>=3.1", "oldest-supported-numpy", "setuptools>=65.5.0", From 60d27910d728a3d796db9b9e0e27e0b81409f6b0 Mon Sep 17 00:00:00 2001 From: stubbiali Date: Tue, 9 Jan 2024 10:31:08 +0100 Subject: [PATCH 03/19] Relax constraint on setuptools. --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index ba1807a9f..cb3d98717 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,9 +1,9 @@ [build-system] requires = [ "Cython>=0.29", - "mpi4py>=3.1", + "mpi4py>=3.1", "oldest-supported-numpy", - "setuptools>=65.5.0", + "setuptools>=61", ] build-backend = "setuptools.build_meta" From 0744c89bb06489b17f1ed190eb26eed435268da9 Mon Sep 17 00:00:00 2001 From: stubbiali Date: Tue, 9 Jan 2024 15:11:50 +0100 Subject: [PATCH 04/19] Add in-tree build backend. --- MANIFEST.in | 1 + _build/backend.py | 25 +++++++++++++++++++++++++ pyproject.toml | 5 +++-- 3 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 _build/backend.py diff --git a/MANIFEST.in b/MANIFEST.in index e3497466e..545dec44b 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -22,3 +22,4 @@ include *.py include *.release include *.sh include LICENSE +include _build/*.py diff --git a/_build/backend.py b/_build/backend.py new file mode 100644 index 000000000..cefffa925 --- /dev/null +++ b/_build/backend.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +import os +from setuptools.build_meta import * +import subprocess + + +def netcdf_has_parallel_support(): + netcdf4_dir = os.environ.get("NETCDF4_DIR") + ncconfig = os.path.join(netcdf4_dir, "bin", "nc-config") if netcdf4_dir else "nc-config" + process = subprocess.run([ncconfig, "--has-parallel4"], capture_output=True) + out = process.stdout.decode("utf-8").rstrip() + return out == "yes" + + +def get_requires_for_build_editable(config_settings=None): + return ["mpi4py>=3.1"] if netcdf_has_parallel_support() else [] + + +def get_requires_for_build_wheel(config_settings=None): + return ["mpi4py>=3.1"] if netcdf_has_parallel_support() else [] + + +def get_requires_for_build_sdist(config_settings=None): + return ["mpi4py>=3.1"] if netcdf_has_parallel_support() else [] + diff --git a/pyproject.toml b/pyproject.toml index cb3d98717..f0467a670 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,11 +1,12 @@ [build-system] requires = [ "Cython>=0.29", - "mpi4py>=3.1", "oldest-supported-numpy", "setuptools>=61", + "wheel" ] -build-backend = "setuptools.build_meta" +build-backend = "backend" +backend-path = ["_build"] [project] name = "netCDF4" From 64faa9b968121b88d14051c3212ac8076f720049 Mon Sep 17 00:00:00 2001 From: stubbiali Date: Fri, 16 Feb 2024 22:07:52 +0100 Subject: [PATCH 05/19] Debug CI. --- _build/backend.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/_build/backend.py b/_build/backend.py index cefffa925..bd05c2b3e 100644 --- a/_build/backend.py +++ b/_build/backend.py @@ -1,12 +1,24 @@ # -*- coding: utf-8 -*- +import logging import os from setuptools.build_meta import * import subprocess +fmt = logging.Formatter("\n=== NETCDF4 BUILD DEBUG: %(message)s\n") +hdlr = logging.StreamHandler() +hdlr.setFormatter(fmt) +log = logging.getLogger(__name__) +log.setLevel(logging.DEBUG) +log.addHandler(hdlr) + + def netcdf_has_parallel_support(): netcdf4_dir = os.environ.get("NETCDF4_DIR") - ncconfig = os.path.join(netcdf4_dir, "bin", "nc-config") if netcdf4_dir else "nc-config" + ncconfig = ( + os.path.join(netcdf4_dir, "bin", "nc-config") if netcdf4_dir else "nc-config" + ) + log.debug(f"{ncconfig = }") process = subprocess.run([ncconfig, "--has-parallel4"], capture_output=True) out = process.stdout.decode("utf-8").rstrip() return out == "yes" @@ -22,4 +34,3 @@ def get_requires_for_build_wheel(config_settings=None): def get_requires_for_build_sdist(config_settings=None): return ["mpi4py>=3.1"] if netcdf_has_parallel_support() else [] - From d2b05c5741ef33773ac40ffc4d0ccc89d5bd8f29 Mon Sep 17 00:00:00 2001 From: jswhit2 Date: Tue, 28 Oct 2025 14:07:22 -0600 Subject: [PATCH 06/19] add $CONDA_PREFIX/bin to PATH on windows --- .github/workflows/cibuildwheel.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml index 2a2ebf717..516e114ac 100644 --- a/.github/workflows/cibuildwheel.yml +++ b/.github/workflows/cibuildwheel.yml @@ -129,6 +129,7 @@ jobs: uses: pypa/cibuildwheel@v3.2.1 env: CIBW_ARCHS: ${{ matrix.arch }} + CIBW_ENVIRONMENT: > PATH="${CONDA_PREFIX}/bin:$PATH" - uses: actions/upload-artifact@v5 with: From 5fb1c221237937fe24c11af733c11959e801c56e Mon Sep 17 00:00:00 2001 From: jswhit2 Date: Tue, 28 Oct 2025 14:19:23 -0600 Subject: [PATCH 07/19] add CONDA_PREFIX to path in pyproject.toml for cibuildwheel --- .github/workflows/cibuildwheel.yml | 1 - pyproject.toml | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml index 516e114ac..2a2ebf717 100644 --- a/.github/workflows/cibuildwheel.yml +++ b/.github/workflows/cibuildwheel.yml @@ -129,7 +129,6 @@ jobs: uses: pypa/cibuildwheel@v3.2.1 env: CIBW_ARCHS: ${{ matrix.arch }} - CIBW_ENVIRONMENT: > PATH="${CONDA_PREFIX}/bin:$PATH" - uses: actions/upload-artifact@v5 with: diff --git a/pyproject.toml b/pyproject.toml index 73cf86580..61ea02647 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -140,6 +140,7 @@ environment = {MACOSX_DEPLOYMENT_TARGET="14.0"} [tool.cibuildwheel.windows] before-build = "python -m pip install delvewheel" +environment = "PATH=$CONDA_PREFIX/bin:$PATH" repair-wheel-command = [ "delvewheel show {wheel}", "delvewheel repair -w {dest_dir} {wheel}", From 7eef3947bd32ade448d01dfeb090d874f204ff05 Mon Sep 17 00:00:00 2001 From: jswhit2 Date: Tue, 28 Oct 2025 16:48:14 -0600 Subject: [PATCH 08/19] update --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 61ea02647..2605ce84c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -140,7 +140,7 @@ environment = {MACOSX_DEPLOYMENT_TARGET="14.0"} [tool.cibuildwheel.windows] before-build = "python -m pip install delvewheel" -environment = "PATH=$CONDA_PREFIX/bin:$PATH" +environment = "PATH=$PATH:$CONDA_PREFIX/bin" repair-wheel-command = [ "delvewheel show {wheel}", "delvewheel repair -w {dest_dir} {wheel}", From 53f093bde6e308997cc819d532ac22bbf2d1a90c Mon Sep 17 00:00:00 2001 From: stubbiali Date: Mon, 12 Jan 2026 17:12:19 +0100 Subject: [PATCH 09/19] Try using mpi4py<4.1 --- _build/backend.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/_build/backend.py b/_build/backend.py index bd05c2b3e..d8bd73191 100644 --- a/_build/backend.py +++ b/_build/backend.py @@ -25,12 +25,12 @@ def netcdf_has_parallel_support(): def get_requires_for_build_editable(config_settings=None): - return ["mpi4py>=3.1"] if netcdf_has_parallel_support() else [] + return ["mpi4py>=3.1,<4.1"] if netcdf_has_parallel_support() else [] def get_requires_for_build_wheel(config_settings=None): - return ["mpi4py>=3.1"] if netcdf_has_parallel_support() else [] + return ["mpi4py>=3.1,<4.1"] if netcdf_has_parallel_support() else [] def get_requires_for_build_sdist(config_settings=None): - return ["mpi4py>=3.1"] if netcdf_has_parallel_support() else [] + return ["mpi4py>=3.1,<4.1"] if netcdf_has_parallel_support() else [] From 2becaa488afbce13f4536ab0de1b8d428ab2feb9 Mon Sep 17 00:00:00 2001 From: stubbiali Date: Mon, 12 Jan 2026 17:31:09 +0100 Subject: [PATCH 10/19] Try --- pyproject.toml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index fc2d049b0..b59d6238e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,9 +4,10 @@ requires = [ "numpy>=2.0.0", "setuptools>=77.0.1", "setuptools_scm[toml]>=3.4", + "mpi4py<4.1.0", ] -build-backend = "backend" -backend-path = ["_build"] +build-backend = "setuptools.build_meta" +#backend-path = ["_build"] [project] name = "netCDF4" From c79546bc685e2e0cb648dcb2f399d5fd97aacf90 Mon Sep 17 00:00:00 2001 From: stubbiali Date: Tue, 13 Jan 2026 09:46:44 +0100 Subject: [PATCH 11/19] Revert "Try" This reverts commit 2becaa488afbce13f4536ab0de1b8d428ab2feb9. --- pyproject.toml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index b59d6238e..fc2d049b0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,10 +4,9 @@ requires = [ "numpy>=2.0.0", "setuptools>=77.0.1", "setuptools_scm[toml]>=3.4", - "mpi4py<4.1.0", ] -build-backend = "setuptools.build_meta" -#backend-path = ["_build"] +build-backend = "backend" +backend-path = ["_build"] [project] name = "netCDF4" From cc5353709c26d68714b900c0e37b11e18a4cf1c4 Mon Sep 17 00:00:00 2001 From: stubbiali Date: Tue, 13 Jan 2026 11:07:05 +0100 Subject: [PATCH 12/19] Sort alphabetically --- _build/backend.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_build/backend.py b/_build/backend.py index d8bd73191..faf8e77bc 100644 --- a/_build/backend.py +++ b/_build/backend.py @@ -28,9 +28,9 @@ def get_requires_for_build_editable(config_settings=None): return ["mpi4py>=3.1,<4.1"] if netcdf_has_parallel_support() else [] -def get_requires_for_build_wheel(config_settings=None): +def get_requires_for_build_sdist(config_settings=None): return ["mpi4py>=3.1,<4.1"] if netcdf_has_parallel_support() else [] -def get_requires_for_build_sdist(config_settings=None): +def get_requires_for_build_wheel(config_settings=None): return ["mpi4py>=3.1,<4.1"] if netcdf_has_parallel_support() else [] From 58770aa821af59de1d5ad239dda6a6e5816be1c9 Mon Sep 17 00:00:00 2001 From: stubbiali Date: Tue, 13 Jan 2026 11:07:19 +0100 Subject: [PATCH 13/19] Constrain mpi4py --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index fc2d049b0..aa42bf073 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -50,7 +50,7 @@ tests = [ "typing-extensions>=4.15.0", ] parallel = [ - "mpi4py", + "mpi4py<4.1", ] [project.readme] From 05a5ce4069db80e9bcf9a396938b917d56f14b77 Mon Sep 17 00:00:00 2001 From: stubbiali Date: Wed, 14 Jan 2026 09:54:39 +0100 Subject: [PATCH 14/19] Fix setup.py --- setup.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/setup.py b/setup.py index 8c0242307..c3b934606 100644 --- a/setup.py +++ b/setup.py @@ -417,17 +417,18 @@ def _populate_hdf5_info(dirstosearch, inc_dirs, libs, lib_dirs): print(f"netcdf lib {has_has_not} parallel functions") if has_parallel_support: + # note(stubbiali): mpi4py is not available when using the in-tree build backend try: import mpi4py except ImportError: - msg = "Parallel support requires mpi4py but it is not installed." - raise ImportError(msg) - - inc_dirs.append(mpi4py.get_include()) - # mpi_incdir should not be needed if using nc-config - # (should be included in nc-config --cflags) - if mpi_incdir is not None: - inc_dirs.append(mpi_incdir) + mpi4py = None + + if mpi4py is not None: + inc_dirs.append(mpi4py.get_include()) + # mpi_incdir should not be needed if using nc-config + # (should be included in nc-config --cflags) + if mpi_incdir is not None: + inc_dirs.append(mpi_incdir) # Name of file containing imports required for parallel support parallel_support_imports = "parallel_support_imports.pxi.in" From b3635d7c3bc0f78ad125d1d9be66ca8923924656 Mon Sep 17 00:00:00 2001 From: stubbiali Date: Thu, 15 Jan 2026 08:51:11 +0100 Subject: [PATCH 15/19] Use utilities from setup.py to check if netcdf has parallel support --- _build/backend.py | 28 ++-------- _build/utils.py | 127 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 131 insertions(+), 24 deletions(-) create mode 100644 _build/utils.py diff --git a/_build/backend.py b/_build/backend.py index faf8e77bc..b4ac4fd17 100644 --- a/_build/backend.py +++ b/_build/backend.py @@ -1,36 +1,16 @@ # -*- coding: utf-8 -*- -import logging -import os from setuptools.build_meta import * -import subprocess - -fmt = logging.Formatter("\n=== NETCDF4 BUILD DEBUG: %(message)s\n") -hdlr = logging.StreamHandler() -hdlr.setFormatter(fmt) -log = logging.getLogger(__name__) -log.setLevel(logging.DEBUG) -log.addHandler(hdlr) - - -def netcdf_has_parallel_support(): - netcdf4_dir = os.environ.get("NETCDF4_DIR") - ncconfig = ( - os.path.join(netcdf4_dir, "bin", "nc-config") if netcdf4_dir else "nc-config" - ) - log.debug(f"{ncconfig = }") - process = subprocess.run([ncconfig, "--has-parallel4"], capture_output=True) - out = process.stdout.decode("utf-8").rstrip() - return out == "yes" +import utils def get_requires_for_build_editable(config_settings=None): - return ["mpi4py>=3.1,<4.1"] if netcdf_has_parallel_support() else [] + return ["mpi4py>=3.1,<4.1"] if utils.netcdf4_has_parallel_support() else [] def get_requires_for_build_sdist(config_settings=None): - return ["mpi4py>=3.1,<4.1"] if netcdf_has_parallel_support() else [] + return ["mpi4py>=3.1,<4.1"] if utils.netcdf4_has_parallel_support() else [] def get_requires_for_build_wheel(config_settings=None): - return ["mpi4py>=3.1,<4.1"] if netcdf_has_parallel_support() else [] + return ["mpi4py>=3.1,<4.1"] if utils.netcdf4_has_parallel_support() else [] diff --git a/_build/utils.py b/_build/utils.py new file mode 100644 index 000000000..feb7b8fb6 --- /dev/null +++ b/_build/utils.py @@ -0,0 +1,127 @@ +# -*- coding: utf-8 -*- +""" +This module contains a streamlined version of some utilities defined in `setup.py`, to be at +disposal of in-tree build backends. +""" + +import configparser +import os +import subprocess + + +PROJECT_ROOT_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), "..")) +OPEN_KWARGS = {"encoding": "utf-8"} + + +def get_config_flags(command: list[str], flag: str) -> list[str]: + """Pull out specific flags from a config command (pkg-config or nc-config)""" + flags = subprocess.run(command, capture_output=True, text=True) + return [arg[2:] for arg in flags.stdout.split() if arg.startswith(flag)] + + +def is_netcdf4_include_dir(inc_dir: str) -> bool: + try: + f = open(os.path.join(inc_dir, "netcdf.h"), **OPEN_KWARGS) + except OSError: + return False + + for line in f: + if line.startswith("nc_inq_compound"): + return True + return False + + +def get_netcdf4_include_dir(): + netcdf4_dir = os.environ.get("NETCDF4_DIR") + netcdf4_incdir = os.environ.get("NETCDF4_INCDIR") + + if bool(int(os.environ.get("USE_SETUPCFG", 1))) and os.path.exists( + setup_cfg := os.path.join(PROJECT_ROOT_DIR, "setup.cfg") + ): + config = configparser.ConfigParser() + config.read(setup_cfg) + + netcdf4_dir = config.get("directories", "NETCDF4_DIR", fallback=netcdf4_dir) + netcdf4_incdir = config.get( + "directories", "NETCDF4_INCDIR", fallback=netcdf4_incdir + ) + + # make sure USE_NCCONFIG from environment takes precedence over use_ncconfig from setup.cfg + # (issue #341) + if "USE_NCCONFIG" in os.environ: + use_ncconfig = bool(int(os.environ.get("USE_NCCONFIG", 0))) + else: + use_ncconfig = config.getboolean("options", "use_ncconfig", fallback=None) + + ncconfig = config.get("options", "ncconfig", fallback=None) + else: + use_ncconfig = None + ncconfig = None + + try: + if ncconfig is None: + if netcdf4_dir is not None: + ncconfig = os.path.join(netcdf4_dir, "bin", "nc-config") + else: # otherwise, just hope it's in the users PATH + ncconfig = "nc-config" + has_ncconfig = subprocess.call([ncconfig, "--libs"]) == 0 + except OSError: + has_ncconfig = False + + # if nc-config exists, and USE_NCCONFIG not set, try to use it + if use_ncconfig is None and has_ncconfig: + use_ncconfig = has_ncconfig + + dirs_to_search = [] + if os.environ.get("CONDA_PREFIX"): + dirs_to_search.append(os.environ["CONDA_PREFIX"]) # linux,macosx + dirs_to_search.append( + os.path.join(os.environ["CONDA_PREFIX"], "Library") + ) # windows + dirs_to_search += [ + os.path.expanduser("~"), + "/usr/local", + "/sw", + "/opt", + "/opt/local", + "/opt/homebrew", + "/usr", + ] + + if netcdf4_incdir is None and netcdf4_dir is None: + if use_ncconfig and has_ncconfig: + inc_dirs = get_config_flags([ncconfig, "--cflags"], "-I") + else: + inc_dirs = [os.path.join(dir_, "include") for dir_ in dirs_to_search] + + for inc_dir in inc_dirs: + if is_netcdf4_include_dir(inc_dir): + netcdf4_incdir = inc_dir + break + + if netcdf4_incdir is None: + raise ValueError("Did not find netCDF version 4 headers.") + else: + if netcdf4_incdir is None: + netcdf4_incdir = os.path.join(netcdf4_dir, "include") + if not is_netcdf4_include_dir(netcdf4_incdir): + raise ValueError( + f"Did not find netCDF version 4 headers under `{netcdf4_incdir}`." + ) + + return netcdf4_incdir + + +def netcdf4_has_parallel_support() -> bool: + netcdf4_incdir = get_netcdf4_include_dir() + if os.path.exists(ncmetapath := os.path.join(netcdf4_incdir, "netcdf_meta.h")): + with open(ncmetapath) as f: + for line in f: + if line.startswith("#define NC_HAS_PARALLEL"): + try: + return bool(int(line.split()[2])) + except ValueError: + pass + return False + else: + return False From 26530b349781ad2850820195a79633cb969439bc Mon Sep 17 00:00:00 2001 From: stubbiali Date: Thu, 15 Jan 2026 08:53:24 +0100 Subject: [PATCH 16/19] Add module docstring --- _build/backend.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/_build/backend.py b/_build/backend.py index b4ac4fd17..270893307 100644 --- a/_build/backend.py +++ b/_build/backend.py @@ -1,4 +1,9 @@ # -*- coding: utf-8 -*- +""" +In-tree build backend that programmatically adds mpi4py to the list of build dependencies if the +underlying netCDF-c library has parallel support enabled. +""" + from setuptools.build_meta import * import utils From d893f5e5f451c55e00e1b3e2eef3fd6b218ca7a5 Mon Sep 17 00:00:00 2001 From: stubbiali Date: Thu, 15 Jan 2026 08:55:56 +0100 Subject: [PATCH 17/19] Fix comment --- _build/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_build/utils.py b/_build/utils.py index feb7b8fb6..ce7938144 100644 --- a/_build/utils.py +++ b/_build/utils.py @@ -68,7 +68,7 @@ def get_netcdf4_include_dir(): except OSError: has_ncconfig = False - # if nc-config exists, and USE_NCCONFIG not set, try to use it + # if nc-config exists, and use_ncconfig not set, try to use it if use_ncconfig is None and has_ncconfig: use_ncconfig = has_ncconfig From 865eac859a4495492b393e154077f7eef9767898 Mon Sep 17 00:00:00 2001 From: stubbiali Date: Thu, 15 Jan 2026 09:02:31 +0100 Subject: [PATCH 18/19] Cosmetics --- _build/backend.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_build/backend.py b/_build/backend.py index 270893307..f9c9cd7a2 100644 --- a/_build/backend.py +++ b/_build/backend.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- """ In-tree build backend that programmatically adds mpi4py to the list of build dependencies if the -underlying netCDF-c library has parallel support enabled. +underlying netCDF4 C library has parallel support enabled. """ from setuptools.build_meta import * From 7a59bfd39aa8f6579a58760d5cd04f6d1de50d8a Mon Sep 17 00:00:00 2001 From: stubbiali Date: Thu, 15 Jan 2026 09:04:48 +0100 Subject: [PATCH 19/19] Try removing upper constraint on mpi4py --- _build/backend.py | 6 +++--- pyproject.toml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/_build/backend.py b/_build/backend.py index f9c9cd7a2..11764a849 100644 --- a/_build/backend.py +++ b/_build/backend.py @@ -10,12 +10,12 @@ def get_requires_for_build_editable(config_settings=None): - return ["mpi4py>=3.1,<4.1"] if utils.netcdf4_has_parallel_support() else [] + return ["mpi4py>=3.1"] if utils.netcdf4_has_parallel_support() else [] def get_requires_for_build_sdist(config_settings=None): - return ["mpi4py>=3.1,<4.1"] if utils.netcdf4_has_parallel_support() else [] + return ["mpi4py>=3.1"] if utils.netcdf4_has_parallel_support() else [] def get_requires_for_build_wheel(config_settings=None): - return ["mpi4py>=3.1,<4.1"] if utils.netcdf4_has_parallel_support() else [] + return ["mpi4py>=3.1"] if utils.netcdf4_has_parallel_support() else [] diff --git a/pyproject.toml b/pyproject.toml index aa42bf073..fc2d049b0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -50,7 +50,7 @@ tests = [ "typing-extensions>=4.15.0", ] parallel = [ - "mpi4py<4.1", + "mpi4py", ] [project.readme]