From 7b94e278abd81418baa2271cfd889769f0e8d662 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 3 Apr 2026 03:33:11 +0000 Subject: [PATCH 1/7] Bump pypa/cibuildwheel from 3.4.0 to 3.4.1 in the github-actions group Bumps the github-actions group with 1 update: [pypa/cibuildwheel](https://github.com/pypa/cibuildwheel). Updates `pypa/cibuildwheel` from 3.4.0 to 3.4.1 - [Release notes](https://github.com/pypa/cibuildwheel/releases) - [Changelog](https://github.com/pypa/cibuildwheel/blob/main/docs/changelog.md) - [Commits](https://github.com/pypa/cibuildwheel/compare/v3.4.0...v3.4.1) --- updated-dependencies: - dependency-name: pypa/cibuildwheel dependency-version: 3.4.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-actions ... Signed-off-by: dependabot[bot] --- .github/workflows/cibuildwheel.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml index de503b531..82e014edd 100644 --- a/.github/workflows/cibuildwheel.yml +++ b/.github/workflows/cibuildwheel.yml @@ -85,7 +85,7 @@ jobs: if: ${{ github.event_name }} == "pull_request" - name: "Building ${{ matrix.os }} (${{ matrix.arch }}) wheels" - uses: pypa/cibuildwheel@v3.4.0 + uses: pypa/cibuildwheel@v3.4.1 env: CIBW_ARCHS: ${{ matrix.arch }} @@ -128,7 +128,7 @@ jobs: python=${{ matrix.python-version }} libnetcdf=4.9.3 --channel conda-forge - name: Build wheels for Windows/Mac - uses: pypa/cibuildwheel@v3.4.0 + uses: pypa/cibuildwheel@v3.4.1 env: CIBW_ARCHS: ${{ matrix.arch }} @@ -167,7 +167,7 @@ jobs: echo "NETCDF4_DIR=C:\vcpkg\installed\arm64-windows" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - name: Build wheels for Windows ARM64 - uses: pypa/cibuildwheel@v3.4.0 + uses: pypa/cibuildwheel@v3.4.1 env: CIBW_ARCHS: ARM64 CIBW_SKIP: "cp310-*" From e7b29060b49353dfb906717cf8174165e6db6295 Mon Sep 17 00:00:00 2001 From: jswhit2 Date: Sat, 25 Apr 2026 16:14:10 -0600 Subject: [PATCH 2/7] fix failing stubtest --- src/netCDF4/__init__.pyi | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/netCDF4/__init__.pyi b/src/netCDF4/__init__.pyi index 4b11688b1..27d3db8ae 100644 --- a/src/netCDF4/__init__.pyi +++ b/src/netCDF4/__init__.pyi @@ -385,13 +385,13 @@ class Dataset: def has_zstd_filter(self) -> bool: ... def has_bzip2_filter(self) -> bool: ... def has_szip_filter(self) -> bool: ... - def __getitem__(self, elem: str) -> Any: ... # should be Group | Variable, but this causes too many problems + def __getitem__(self, elem: str, /) -> Any: ... # should be Group | Variable, but this causes too many problems # __iter__ and __contains__ always error because iteration and membership ops are not allowed def __iter__(self) -> NoReturn: ... def __contains__(self, key) -> NoReturn: ... - def __setattr__(self, name: str, value: Any) -> None: ... - def __getattr__(self, name: str) -> Any: ... - def __delattr__(self, name: str): ... + def __setattr__(self, name: str, value: Any, /) -> None: ... + def __getattr__(self, name: str, /) -> Any: ... + def __delattr__(self, name: str, /): ... def __reduce__(self) -> NoReturn: ... def __enter__(self) -> Self: ... def __exit__(self, atype, value, traceback) -> None: ... @@ -585,11 +585,11 @@ class Variable(Generic[VarT]): def set_ncstring_attrs(self, ncstring_attrs: bool) -> None: ... def set_collective(self, value: bool) -> None: ... def get_dims(self) -> tuple[Dimension, ...]: ... - def __delattr__(self, name: str) -> None: ... - def __setattr__(self, name: str, value: Any) -> None: ... - def __getattr__(self, name: str) -> Any: ... - def __getitem__(self, elem: Any) -> Any: ... - def __setitem__(self, elem: Any, data: npt.ArrayLike) -> None: ... + def __delattr__(self, name: str, /) -> None: ... + def __setattr__(self, name: str, value: Any, /) -> None: ... + def __getattr__(self, name: str, /) -> Any: ... + def __getitem__(self, elem: Any, /) -> Any: ... + def __setitem__(self, elem: Any, data: npt.ArrayLike, /) -> None: ... def __array__(self) -> np.ndarray: ... def __len__(self) -> int: ... def __iter__(self) -> Iterator[Any]: ... # faux method so mypy believes Variable is iterable From 4c1fc11cb8e8c55d0f2ab5e021893d57f7d2e31d Mon Sep 17 00:00:00 2001 From: jswhit2 Date: Sat, 25 Apr 2026 16:21:21 -0600 Subject: [PATCH 3/7] fix failing stubtest --- src/netCDF4/__init__.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/netCDF4/__init__.pyi b/src/netCDF4/__init__.pyi index 27d3db8ae..bb0c30831 100644 --- a/src/netCDF4/__init__.pyi +++ b/src/netCDF4/__init__.pyi @@ -388,7 +388,7 @@ class Dataset: def __getitem__(self, elem: str, /) -> Any: ... # should be Group | Variable, but this causes too many problems # __iter__ and __contains__ always error because iteration and membership ops are not allowed def __iter__(self) -> NoReturn: ... - def __contains__(self, key) -> NoReturn: ... + def __contains__(self, key, /) -> NoReturn: ... def __setattr__(self, name: str, value: Any, /) -> None: ... def __getattr__(self, name: str, /) -> Any: ... def __delattr__(self, name: str, /): ... From 4809a23edea9f8d091851ba33e65bb575bbbbfad Mon Sep 17 00:00:00 2001 From: jswhit2 Date: Sat, 25 Apr 2026 16:27:38 -0600 Subject: [PATCH 4/7] fix failing stubtest --- .github/stubtest-allowlist | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/stubtest-allowlist b/.github/stubtest-allowlist index 0352fdcf7..ed82f4a85 100644 --- a/.github/stubtest-allowlist +++ b/.github/stubtest-allowlist @@ -26,10 +26,6 @@ netCDF4.VarT netCDF4.RealVarT netCDF4.ComplexVarT netCDF4.NumericVarT -netCDF4.Dimension.__reduce_cython__ -netCDF4.Dimension.__setstate_cython__ -netCDF4.Variable.auto_complex -netCDF4.Variable.__iter__ netCDF4._netCDF4.Dimension.__reduce_cython__ netCDF4._netCDF4.Dimension.__setstate_cython__ netCDF4._netCDF4.NC_DISKLESS From 62a5cbb4f4f78b0a100307aa852e8c9e49ced9ad Mon Sep 17 00:00:00 2001 From: jswhit2 Date: Sat, 25 Apr 2026 16:35:39 -0600 Subject: [PATCH 5/7] revert previous --- .github/stubtest-allowlist | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/stubtest-allowlist b/.github/stubtest-allowlist index ed82f4a85..0352fdcf7 100644 --- a/.github/stubtest-allowlist +++ b/.github/stubtest-allowlist @@ -26,6 +26,10 @@ netCDF4.VarT netCDF4.RealVarT netCDF4.ComplexVarT netCDF4.NumericVarT +netCDF4.Dimension.__reduce_cython__ +netCDF4.Dimension.__setstate_cython__ +netCDF4.Variable.auto_complex +netCDF4.Variable.__iter__ netCDF4._netCDF4.Dimension.__reduce_cython__ netCDF4._netCDF4.Dimension.__setstate_cython__ netCDF4._netCDF4.NC_DISKLESS From dde81386b945eb621783640788f14324f7add4e2 Mon Sep 17 00:00:00 2001 From: jswhit2 Date: Sat, 25 Apr 2026 16:52:31 -0600 Subject: [PATCH 6/7] don't fail on stubtest warning --- .github/workflows/build_master.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build_master.yml b/.github/workflows/build_master.yml index 5459dd52f..7da2d0f42 100644 --- a/.github/workflows/build_master.yml +++ b/.github/workflows/build_master.yml @@ -91,3 +91,5 @@ jobs: stubtest netCDF4 --allowlist .github/stubtest-allowlist --mypy-config-file=pyproject.toml mypy test mypy examples + env: + CI: false From 88522af1d9237707eb3508de00f5f16f45f25611 Mon Sep 17 00:00:00 2001 From: jswhit2 Date: Sat, 25 Apr 2026 16:58:16 -0600 Subject: [PATCH 7/7] try to silence stubtest warnings --- .github/workflows/build_master.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/build_master.yml b/.github/workflows/build_master.yml index 7da2d0f42..61799f6c3 100644 --- a/.github/workflows/build_master.yml +++ b/.github/workflows/build_master.yml @@ -88,8 +88,6 @@ jobs: - name: Stubtest run: | - stubtest netCDF4 --allowlist .github/stubtest-allowlist --mypy-config-file=pyproject.toml + stubtest netCDF4 --allowlist .github/stubtest-allowlist --ignore-unused-allowlist --mypy-config-file=pyproject.toml mypy test mypy examples - env: - CI: false