Skip to content

Commit 7e1af94

Browse files
committed
Merge remote-tracking branch 'upstream/master' into mpi
2 parents 43713de + a332de8 commit 7e1af94

28 files changed

Lines changed: 354 additions & 174 deletions

‎.github/workflows/build_latest.yml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jobs:
55
name: Python (${{ matrix.python-version }})
66
runs-on: ubuntu-latest
77
env:
8-
PNETCDF_VERSION: 1.14.0
8+
PNETCDF_VERSION: 1.14.1
99
NETCDF_VERSION: 4.9.3
1010
NETCDF_DIR: ${{ github.workspace }}/..
1111
NETCDF_EXTRA_CONFIG: --enable-pnetcdf
@@ -14,15 +14,15 @@ jobs:
1414
#NO_NET: 1
1515
strategy:
1616
matrix:
17-
python-version: ["3.13"]
17+
python-version: ["3.14"]
1818
steps:
1919

20-
- uses: actions/checkout@v4
20+
- uses: actions/checkout@v6
2121
with:
2222
submodules: true
2323

2424
- name: Set up Python ${{ matrix.python-version }}
25-
uses: actions/setup-python@v5
25+
uses: actions/setup-python@v6
2626
with:
2727
python-version: ${{ matrix.python-version }}
2828

‎.github/workflows/build_master.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ jobs:
1111
#NO_NET: 1
1212
strategy:
1313
matrix:
14-
python-version: ["3.13"]
14+
python-version: ["3.14"]
1515
steps:
1616

17-
- uses: actions/checkout@v4
17+
- uses: actions/checkout@v6
1818
with:
1919
submodules: true
2020

2121
- name: Set up Python ${{ matrix.python-version }}
22-
uses: actions/setup-python@v5
22+
uses: actions/setup-python@v6
2323
with:
2424
python-version: ${{ matrix.python-version }}
2525

‎.github/workflows/build_old.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ jobs:
1414
#NO_NET: 1
1515
strategy:
1616
matrix:
17-
python-version: ["3.13"]
17+
python-version: ["3.14"]
1818
steps:
1919

20-
- uses: actions/checkout@v4
20+
- uses: actions/checkout@v6
2121
with:
2222
submodules: true
2323

2424
- name: Set up Python ${{ matrix.python-version }}
25-
uses: actions/setup-python@v5
25+
uses: actions/setup-python@v6
2626
with:
2727
python-version: ${{ matrix.python-version }}
2828

‎.github/workflows/cibuildwheel.yml‎

Lines changed: 76 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ jobs:
1818
name: Build source distribution
1919
runs-on: ubuntu-22.04
2020
steps:
21-
- uses: actions/checkout@v4
21+
- uses: actions/checkout@v6
2222
with:
2323
fetch-depth: 0
2424

25-
- uses: actions/setup-python@v5
25+
- uses: actions/setup-python@v6
2626
name: Install Python
2727
with:
2828
python-version: 3.x
@@ -38,7 +38,7 @@ jobs:
3838
pip install build
3939
&& python -m build --sdist . --outdir dist
4040
41-
- uses: actions/upload-artifact@v4
41+
- uses: actions/upload-artifact@v6
4242
with:
4343
name: pypi-artifacts
4444
path: ${{ github.workspace }}/dist/*.tar.gz
@@ -55,17 +55,11 @@ jobs:
5555
include:
5656
- os: ubuntu-22.04
5757
arch: x86_64
58-
- os: ubuntu-22.04
58+
- os: ubuntu-24.04-arm
5959
arch: aarch64
60-
- os: macos-14
61-
arch: arm64
62-
CIBW_ENVIRONMENT: MACOSX_DEPLOYMENT_TARGET=14.0
63-
- os: macos-12
64-
arch: x86_64
65-
CIBW_ENVIRONMENT: MACOSX_DEPLOYMENT_TARGET=12.0
6660

6761
steps:
68-
- uses: actions/checkout@v4
62+
- uses: actions/checkout@v6
6963
with:
7064
fetch-depth: 0
7165

@@ -80,54 +74,47 @@ jobs:
8074
shell: bash
8175
# On PRs we run only oldest and newest Python versions to reduce CI load.
8276
# Skips pypy and musllinux everywhere.
83-
# We are buiding 38 and 312 for now.
77+
# We are building 310, 311 and 314 for now.
78+
# (3.11 is the oldest version for which we support abi3 wheels)
8479
# These needs to rotate every new Python release.
8580
run: |
86-
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
87-
CIBW_SKIP="pp* cp36-* cp37-* cp38-* *-musllinux* cp39-* cp310-* cp311-* cp312-*"
88-
else
89-
CIBW_SKIP="pp* cp36-* cp37-* cp38-* *-musllinux*"
90-
fi
91-
echo "CIBW_SKIP=$CIBW_SKIP" >> $GITHUB_ENV
92-
echo "Setting CIBW_SKIP=$CIBW_SKIP"
81+
set -x
82+
echo "CIBW_BUILD=cp310-* cp311-* cp314-* cp314t-*" >> $GITHUB_ENV
83+
set +x
84+
85+
if: ${{ github.event_name }} == "pull_request"
9386

9487
- name: "Building ${{ matrix.os }} (${{ matrix.arch }}) wheels"
95-
uses: pypa/cibuildwheel@v3.0.0
88+
uses: pypa/cibuildwheel@v3.3.1
9689
env:
97-
CIBW_SKIP: ${{ env.CIBW_SKIP }}
9890
CIBW_ARCHS: ${{ matrix.arch }}
99-
CIBW_BUILD_FRONTEND: build
100-
CIBW_MANYLINUX_X86_64_IMAGE: ghcr.io/ocefpaf/manylinux2014_x86_64-netcdf
101-
CIBW_MANYLINUX_AARCH64_IMAGE: ghcr.io/ocefpaf/manylinux2014_aarch64-netcdf
102-
# Emulation testing is slow, testing only latest Python.
103-
CIBW_TEST_SKIP: "cp39-*_aarch64 cp310-*_aarch64 cp311-*_aarch64 cp312-*_aarch64"
104-
CIBW_ENVIRONMENT: ${{ matrix.CIBW_ENVIRONMENT }}
105-
CIBW_BEFORE_BUILD_MACOS: brew install hdf5 netcdf
106-
CIBW_TEST_REQUIRES: pytest cython packaging typing-extensions
107-
CIBW_TEST_COMMAND: >
108-
python -c "import netCDF4; print(f'netCDF4 v{netCDF4.__version__}')"
109-
&& pytest -s -rxs -v {project}/test
110-
111-
- uses: actions/upload-artifact@v4
91+
92+
- uses: actions/upload-artifact@v6
11293
with:
11394
name: pypi-artifacts-${{ matrix.os }}-${{ matrix.arch }}
11495
path: ${{ github.workspace }}/wheelhouse/*.whl
11596

11697

117-
build_wheels_windows:
98+
build_wheels_winmac:
11899
name: Build wheels for ${{matrix.arch}} on ${{ matrix.os }}
119100
runs-on: ${{ matrix.os }}
120101
strategy:
102+
fail-fast: false
121103
matrix:
122-
os: [windows-latest]
123-
arch: [win_amd64]
104+
include:
105+
- os: windows-latest
106+
arch: AMD64
107+
- os: macos-14
108+
arch: arm64
109+
- os: macos-15-intel
110+
arch: x86_64
124111

125112
steps:
126-
- uses: actions/checkout@v4
113+
- uses: actions/checkout@v6
127114
with:
128115
fetch-depth: 0
129116

130-
- uses: actions/setup-python@v5
117+
- uses: actions/setup-python@v6
131118
name: Install Python
132119
with:
133120
python-version: 3.x
@@ -138,40 +125,65 @@ jobs:
138125
environment-name: build
139126
init-shell: bash
140127
create-args: >-
141-
python=${{ matrix.python-version }} libnetcdf=4.9.2 --channel conda-forge
128+
python=${{ matrix.python-version }} libnetcdf=4.9.3 --channel conda-forge
142129
143-
- name: Install cibuildwheel
144-
run: |
145-
python -m pip install --upgrade cibuildwheel delvewheel
146-
147-
- name: Build wheels for Windows (${{ matrix.arch }})
148-
run: cibuildwheel --output-dir wheelhouse
130+
- name: Build wheels for Windows/Mac
131+
uses: pypa/cibuildwheel@v3.3.1
149132
env:
150-
CIBW_BUILD: "cp39-${{ matrix.arch }} cp310-${{ matrix.arch }} cp311-${{ matrix.arch }} cp312-${{ matrix.arch }} cp313-${{ matrix.arch }}"
151-
CIBW_ENVIRONMENT_WINDOWS: >
152-
HDF5_DIR="C:\\Users\\runneradmin\\micromamba\\envs\\build\\Library"
153-
netCDF4_DIR="C:\\Users\\runneradmin\\micromamba\\envs\\build\\Library"
154-
PATH="C:\\Users\\runneradmin\\micromamba\\envs\\build\\Library\\bin;${PATH}"
155-
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: >
156-
delvewheel show {wheel}
157-
&& delvewheel repair -w {dest_dir} {wheel}
158-
CIBW_TEST_REQUIRES: pytest cython packaging typing-extensions
159-
CIBW_TEST_COMMAND: >
160-
python -c "import netCDF4; print(f'netCDF4 v{netCDF4.__version__}')"
161-
&& pytest -s -rxs -v {project}\\test
162-
163-
- uses: actions/upload-artifact@v4
133+
CIBW_ARCHS: ${{ matrix.arch }}
134+
135+
- uses: actions/upload-artifact@v6
164136
with:
165137
name: pypi-artifacts-${{ matrix.os }}-${{ matrix.arch }}
166138
path: ${{ github.workspace }}/wheelhouse/*.whl
167139

168140

141+
build_wheels_windows_arm:
142+
name: Build wheels for ARM64 on Windows
143+
runs-on: windows-11-arm
144+
steps:
145+
- uses: actions/checkout@v6
146+
with:
147+
fetch-depth: 0
148+
149+
- uses: actions/setup-python@v6
150+
name: Install Python
151+
with:
152+
python-version: 3.x
153+
154+
- name: Install vcpkg dependencies
155+
shell: pwsh
156+
run: |
157+
# Install vcpkg
158+
git clone https://github.com/Microsoft/vcpkg.git C:\vcpkg
159+
cd C:\vcpkg
160+
.\bootstrap-vcpkg.bat
161+
162+
# Install netcdf and dependencies
163+
.\vcpkg.exe install hdf5:arm64-windows netcdf-c:arm64-windows zlib:arm64-windows
164+
165+
# Set environment variables for build
166+
echo "HDF5_DIR=C:\vcpkg\installed\arm64-windows" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
167+
echo "NETCDF4_DIR=C:\vcpkg\installed\arm64-windows" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
168+
169+
- name: Build wheels for Windows ARM64
170+
uses: pypa/cibuildwheel@v3.3.1
171+
env:
172+
CIBW_ARCHS: ARM64
173+
CIBW_SKIP: "cp310-*"
174+
175+
- uses: actions/upload-artifact@v6
176+
with:
177+
name: pypi-artifacts-windows-11-arm-ARM64
178+
path: ${{ github.workspace }}/wheelhouse/*.whl
179+
180+
169181
show-artifacts:
170-
needs: [build_bdist, build_sdist, build_wheels_windows]
182+
needs: [build_bdist, build_sdist, build_wheels_winmac, build_wheels_windows_arm]
171183
name: "Show artifacts"
172184
runs-on: ubuntu-22.04
173185
steps:
174-
- uses: actions/download-artifact@v4
186+
- uses: actions/download-artifact@v7
175187
with:
176188
pattern: pypi-artifacts*
177189
path: ${{ github.workspace }}/dist
@@ -183,13 +195,13 @@ jobs:
183195
184196
185197
publish-artifacts-pypi:
186-
needs: [build_bdist, build_sdist, build_wheels_windows]
198+
needs: [build_bdist, build_sdist, build_wheels_winmac, build_wheels_windows_arm]
187199
name: "Publish to PyPI"
188200
runs-on: ubuntu-22.04
189201
# upload to PyPI for every tag starting with 'v'
190202
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
191203
steps:
192-
- uses: actions/download-artifact@v4
204+
- uses: actions/download-artifact@v7
193205
with:
194206
pattern: pypi-artifacts*
195207
path: ${{ github.workspace }}/dist

‎.github/workflows/miniconda.yml‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
# NO_NET: 1
1313
strategy:
1414
matrix:
15-
python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13" ]
15+
python-version: [ "3.10", "3.11", "3.12", "3.13", "3.14" ]
1616
os: [windows-latest, ubuntu-latest, macos-latest]
1717
platform: [x64, x32]
1818
exclude:
@@ -24,7 +24,7 @@ jobs:
2424
shell: bash -l {0}
2525

2626
steps:
27-
- uses: actions/checkout@v4
27+
- uses: actions/checkout@v6
2828
with:
2929
submodules: true
3030

@@ -45,6 +45,11 @@ jobs:
4545
4646
- name: Tests
4747
run: |
48+
if [ "$RUNNER_OS" == "Windows" ]; then
49+
export HDF5_PLUGIN_PATH="${CONDA_PREFIX}\\Library\\hdf5\\lib\\plugin"
50+
else
51+
export HDF5_PLUGIN_PATH="${CONDA_PREFIX}/hdf5/lib/plugin/"
52+
fi
4853
pytest -s -rxs -v test
4954
5055
run-mpi:
@@ -58,7 +63,7 @@ jobs:
5863
run:
5964
shell: bash -l {0}
6065
steps:
61-
- uses: actions/checkout@v4
66+
- uses: actions/checkout@v6
6267
with:
6368
submodules: true
6469

‎Changelog‎

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
1-
since version 1.7.2 release
2-
===========================
1+
version 1.7.4 (tag v1.7.4rel)
2+
================================
3+
* Make sure automatic conversion of character arrays <--> string arrays works for Unicode strings (issue #1440).
4+
(previously only worked correctly for encoding="ascii").
5+
* Add netcdf plugins (blosc, zstd, bzip2) in wheels. Blosc plugin doesn't work in Windows wheels.
6+
Macos wheels now use conda provided libs. (PR #1450)
7+
* Add windows/arm (PR #1453) and free-threaded python wheels (issue #1454). Windows wheels now use netcdf-c 4.9.3.
8+
WARNING: netcdf-c is not thread-safe and netcdf4-python does have internal locking so expect segfaults if you
9+
use netcdf4-python on multiple threads with free-threaded python. Users must exercise care to only call netcdf from
10+
a single thread.
11+
12+
version 1.7.3 (tag v1.7.3rel)
13+
=============================
14+
* Python 3.14 wheels (issue #1432)
315
* support os.PathLike arguments for `Dataset.fromcdl` and raise a `FileNotFoundError`
416
if the cdl is missing and a `FileExistsError` if the nc file already exists (PR #1387)
517
* raise more informative error when trying to iterate or

‎MANIFEST.in‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,4 @@ include *.md
2727
include *.py
2828
include *.release
2929
include *.sh
30-
include LICENSE
3130
include _build/*.py

‎README.md‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# [netcdf4-python](http://unidata.github.io/netcdf4-python)
22
[Python](http://python.org)/[numpy](http://numpy.org) interface to the netCDF [C library](https://github.com/Unidata/netcdf-c).
33

4-
[![Build status](https://github.com/Unidata/netcdf4-python/workflows/Build%20and%20Test/badge.svg)](https://github.com/Unidata/netcdf4-python/actions)
4+
[![CodeQL](https://github.com/Unidata/netcdf4-python/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/Unidata/netcdf4-python/actions/workflows/github-code-scanning/codeql)
55
[![PyPI package](https://img.shields.io/pypi/v/netCDF4.svg)](http://python.org/pypi/netCDF4)
66
[![Anaconda-Server Badge](https://anaconda.org/conda-forge/netCDF4/badges/version.svg)](https://anaconda.org/conda-forge/netCDF4)
77
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.2592291.svg)](https://doi.org/10.5281/zenodo.2592290)
@@ -10,6 +10,14 @@
1010
## News
1111
For details on the latest updates, see the [Changelog](https://github.com/Unidata/netcdf4-python/blob/master/Changelog).
1212

13+
1/5/2026: Version [1.7.4](https://pypi.python.org/pypi/netCDF4/1.7.4) released. Compression plugins now included in wheels, windows/arm64 and
14+
free-threaded python wheels provided. Automatic conversion of character arrays <--> string arrays works for Unicode (not just ascii) strings.
15+
WARNING: netcdf-c is not thread-safe and netcdf4-python does have internal locking so expect segfaults if you
16+
use netcdf4-python on multiple threads with free-threaded python. Users must exercise care to only call netcdf from
17+
a single thread.
18+
19+
10/13/2025: Version [1.7.3](https://pypi.python.org/pypi/netCDF4/1.7.3) released. Minor updates/bugfixes and python 3.14 wheels, see Changelog for details.
20+
1321
10/22/2024: Version [1.7.2](https://pypi.python.org/pypi/netCDF4/1.7.2) released. Minor updates/bugfixes and python 3.13 wheels, see Changelog for details.
1422

1523
06/17/2024: Version [1.7.1](https://pypi.python.org/pypi/netCDF4/1.7.1) released. Fixes for wheels, no code changes.

‎docs/_config.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
theme: jekyll-theme-minimal

0 commit comments

Comments
 (0)