Skip to content

Commit 9e325c7

Browse files
authored
Merge pull request #120 from ecmwf/hotfix/2.39.2
Hotfix/2.39.2
2 parents e291a08 + f8c8abd commit 9e325c7

15 files changed

+78
-31
lines changed

Diff for: .github/workflows/build-wheel-linux.yml

+13-3
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ jobs:
4242
# if: false # for temporarily disabling for debugging
4343

4444
runs-on: [self-hosted, Linux, platform-builder-Rocky-8.6]
45-
container: dockcross/manylinux_2_28-x64:latest
45+
container:
46+
image: dockcross/manylinux_2_28-x64:latest
47+
#options: --pull always
4648

4749
name: Build manylinux_2_28-x64
4850

@@ -91,14 +93,22 @@ jobs:
9193
name: wheel-manylinux2014-3.12
9294
path: wheelhouse/*.whl
9395

96+
# ################################################################
97+
- run: ./scripts/wheel-linux.sh 3.13
98+
- uses: actions/upload-artifact@v4
99+
name: Upload wheel 3.13
100+
with:
101+
name: wheel-manylinux2014-3.13
102+
path: wheelhouse/*.whl
103+
94104
test:
95105

96106
needs: build
97107

98108
strategy:
99109
fail-fast: false
100110
matrix: # We don't test 3.6, as it is not supported anymore by github actions
101-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
111+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
102112

103113
runs-on: [self-hosted, Linux, platform-builder-Rocky-8.6]
104114

@@ -122,7 +132,7 @@ jobs:
122132
strategy:
123133
fail-fast: false
124134
matrix:
125-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
135+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
126136

127137
needs: [test, build]
128138

Diff for: .github/workflows/build-wheel-macos.yml

+13-2
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,15 @@ jobs:
9292
path: wheelhouse/*.whl
9393
- run: rm -fr wheelhouse
9494

95+
- run: ./scripts/wheel-macos.sh "3.13"
96+
- run: ls -l wheelhouse
97+
- uses: actions/upload-artifact@v4
98+
name: Upload wheel 3.13 ${{ matrix.arch_type }}
99+
with:
100+
name: wheel-macos-${{ matrix.arch_type }}-3.13
101+
path: wheelhouse/*.whl
102+
- run: rm -fr wheelhouse
103+
95104
test:
96105
needs: build
97106

@@ -100,7 +109,7 @@ jobs:
100109
max-parallel: 1
101110
matrix:
102111
arch_type: [ARM64, X64]
103-
python-version: ["3.9", "3.10", "3.11", "3.12"]
112+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
104113

105114
runs-on: [self-hosted, macOS, "${{ matrix.arch_type }}"]
106115

@@ -130,14 +139,16 @@ jobs:
130139
max-parallel: 1
131140
matrix:
132141
arch_type: [ARM64, X64]
133-
python-version: ["3.9", "3.10", "3.11", "3.12"]
142+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
134143

135144
runs-on: [self-hosted, macOS, "${{ matrix.arch_type }}"]
136145

137146
steps:
138147

139148
- run: mkdir artifact-${{ matrix.arch_type }}-${{ matrix.python-version }}
140149

150+
- uses: actions/checkout@v4
151+
141152
- uses: actions/download-artifact@v4
142153
with:
143154
name: wheel-macos-${{ matrix.arch_type }}-${{ matrix.python-version }}

Diff for: .github/workflows/build-wheel-windows.yml

+17-2
Original file line numberDiff line numberDiff line change
@@ -144,14 +144,29 @@ jobs:
144144

145145
################################################################
146146

147+
- name: Set up Python 3.13
148+
uses: actions/setup-python@v4
149+
with:
150+
python-version: "3.13"
151+
architecture: ${{ matrix.architecture }}
152+
153+
- run: ./scripts/wheel-windows.sh "3.13"
154+
- uses: actions/upload-artifact@v4
155+
name: Upload wheel 3.13
156+
with:
157+
name: wheel-windows-3.13-${{ matrix.architecture }}
158+
path: wheelhouse/*.whl
159+
160+
################################################################
161+
147162

148163
test:
149164
needs: build
150165
runs-on: windows-latest
151166
strategy:
152167
fail-fast: true
153168
matrix:
154-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
169+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
155170
architecture: ["x64"]
156171

157172
defaults:
@@ -195,7 +210,7 @@ jobs:
195210
strategy:
196211
fail-fast: true
197212
matrix:
198-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
213+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
199214
architecture: ["x64"]
200215

201216
steps:

Diff for: .github/workflows/check-and-publish.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
fail-fast: false
2828
matrix:
2929
platform: [ubuntu-latest, macos-latest, windows-latest]
30-
python-version: ['3.8', '3.9', '3.10', '3.11']
30+
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
3131
method: ['conda', 'ecmwflibs']
3232
exclude:
3333
- platform: macos-latest

Diff for: CHANGELOG.rst

+7
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
Changelog for eccodes-python
33
============================
44

5+
2.39.2 (2025-01-27)
6+
--------------------
7+
8+
- GitHub pull request #109: Allow setting of array in highlevel.Message.set
9+
- Add support for Python version 3.13
10+
11+
512
2.39.1 (2024-12-10)
613
--------------------
714

Diff for: CONTRIBUTING.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ Before you submit a pull request, check that it meets these guidelines:
105105
your new functionality into a function with a docstring, and add the
106106
feature to the list in README.rst.
107107

108-
3. The pull request should work for Python 3.8, 3.9, 3.10, 3.11 and for PyPy2 and PyPy3.
108+
3. The pull request should work for Python 3.9, 3.10, 3.11, 3.12, 3.13 and for PyPy2 and PyPy3.
109109
Check the tox results and make sure that the tests pass for all supported Python versions.
110110

111111

Diff for: README.rst

+5-3
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ https://confluence.ecmwf.int/display/ECC/ecCodes+installation
7474
You may run a simple selfcheck command to ensure that your system is set up correctly::
7575

7676
$ python -m eccodes selfcheck
77-
Found: ecCodes v2.37.0.
77+
Found: ecCodes v2.39.0.
7878
Your system is ready.
7979

8080

@@ -126,15 +126,17 @@ https://github.com/ecmwf/eccodes-python
126126

127127
Please see the CONTRIBUTING.rst document for the best way to help.
128128

129-
Maintainer:
129+
Maintainers:
130130

131131
- `Shahram Najm <https://github.com/shahramn>`_ - `ECMWF <https://ecmwf.int>`_
132+
- `Eugen Betke <https://github.com/joobog>`_ - `ECMWF <https://ecmwf.int>`_
132133

133134
Contributors:
134135

136+
- `Iain Russell <https://github.com/iainrussell>`_ - `ECMWF <https://ecmwf.int>`_
135137
- `Alessandro Amici <https://github.com/alexamici>`_ - `B-Open <https://bopen.eu>`_
136138

137-
See also the list of `contributors <https://github.com/ecmwf/eccodes-python/contributors>`_
139+
See also the list of other `contributors <https://github.com/ecmwf/eccodes-python/contributors>`_
138140
who participated in this project.
139141

140142
.. |copy| unicode:: U+000A9 .. COPYRIGHT SIGN

Diff for: ci/requirements-docs.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ idna==3.7
1818
# via requests
1919
imagesize==1.1.0
2020
# via sphinx
21-
jinja2==3.1.4
21+
jinja2==3.1.5
2222
# via sphinx
2323
markupsafe==2.1.5
2424
# via jinja2

Diff for: eccodes/highlevel/message.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import io
22
from contextlib import contextmanager
33

4+
import numpy as np
5+
46
import eccodes
57

68
_TYPES_MAP = {
@@ -95,23 +97,21 @@ def set(self, *args, check_values: bool = True):
9597

9698
for name, value in key_values.items():
9799
with raise_keyerror(name):
98-
eccodes.codes_set(self._handle, name, value)
100+
if np.ndim(value) > 0:
101+
eccodes.codes_set_array(self._handle, name, value)
102+
else:
103+
eccodes.codes_set(self._handle, name, value)
99104

100105
if check_values:
101106
# Check values just set
102107
for name, value in key_values.items():
103-
cast_value = value
104-
if isinstance(value, str):
105-
saved_value = eccodes.codes_get_string(self._handle, name)
106-
elif isinstance(value, int):
107-
saved_value = eccodes.codes_get_long(self._handle, name)
108+
if type(value) in _TYPES_MAP.values():
109+
saved_value = self.get(f"{name}:{type(value).__name__}")
108110
else:
109111
saved_value = self.get(name)
110-
if not isinstance(value, type(saved_value)):
111-
cast_value = type(saved_value)(value)
112-
if saved_value != cast_value:
112+
if not np.all(saved_value == value):
113113
raise ValueError(
114-
f"Unexpected retrieved value {saved_value} for key {name}. Expected {cast_value}"
114+
f"Unexpected retrieved value {saved_value} for key {name}. Expected {value}"
115115
)
116116

117117
def get_array(self, name):

Diff for: gribapi/bindings.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
import cffi
2525

26-
__version__ = "2.39.1"
26+
__version__ = "2.39.2"
2727

2828
LOG = logging.getLogger(__name__)
2929

Diff for: scripts/build-macos.sh

-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ cd $TOPDIR/build-binaries/eccodes
4040

4141
# We disable JASPER because of a linking issue. JPEG support comes from
4242
# other libraries (e.g. openjpeg)
43-
# For performance, we do not enable thread-safety (would be -DENABLE_THREADS=1 -DECCODES_OMP_THREADS=1),
44-
# but may want to consider in the future
4543
$ARCH $TOPDIR/src/ecbuild/bin/ecbuild \
4644
$TOPDIR/src/eccodes \
4745
-GNinja \

Diff for: scripts/common.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ GIT_ECBUILD=https://github.com/ecmwf/ecbuild.git
1414
ECBUILD_VERSION=master
1515

1616
GIT_ECCODES=https://github.com/ecmwf/eccodes.git
17-
ECCODES_VERSION=2.39.1
17+
ECCODES_VERSION=2.39.2
1818
ECCODES_COMMON_CMAKE_OPTIONS="-DENABLE_PNG=1 -DENABLE_JPG=1 -DENABLE_NETCDF=0 -DENABLE_EXAMPLES=0"
1919

2020
GIT_AEC=https://github.com/MathisRosenhauer/libaec.git

Diff for: scripts/wheel-linux.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ TOPDIR=$(/bin/pwd)
1919

2020
LD_LIBRARY_PATH=$TOPDIR/install/lib:$TOPDIR/install/lib64:$LD_LIBRARY_PATH
2121

22-
sudo /opt/python/cp${version}-cp${version}*/bin/pip3 install 'setuptools>=72.1.0'
23-
/opt/python/cp${version}-cp${version}*/bin/pip3 list
22+
sudo /opt/python/cp${version}-cp${version}/bin/pip3 install 'setuptools>=72.1.0'
23+
/opt/python/cp${version}-cp${version}/bin/pip3 list
2424

2525
rm -fr dist wheelhouse
26-
/opt/python/cp${version}-cp${version}*/bin/python3 setup.py --binary-wheel bdist_wheel
26+
/opt/python/cp${version}-cp${version}/bin/python3 setup.py --binary-wheel bdist_wheel
2727

2828
# Do it twice to get the list of libraries
2929

@@ -35,6 +35,6 @@ pip3 install -r scripts/requirements.txt
3535
python3 ./scripts/copy-licences.py libs
3636

3737
rm -fr dist wheelhouse
38-
/opt/python/cp${version}-cp${version}*/bin/python3 setup.py --binary-wheel bdist_wheel
38+
/opt/python/cp${version}-cp${version}/bin/python3 setup.py --binary-wheel bdist_wheel
3939
auditwheel repair dist/*.whl
4040
rm -fr dist

Diff for: setup.py

+2
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ def shared(directory):
117117
"Programming Language :: Python :: 3.9",
118118
"Programming Language :: Python :: 3.10",
119119
"Programming Language :: Python :: 3.11",
120+
"Programming Language :: Python :: 3.12",
121+
"Programming Language :: Python :: 3.13",
120122
"Programming Language :: Python :: Implementation :: CPython",
121123
"Programming Language :: Python :: Implementation :: PyPy",
122124
"Operating System :: OS Independent",

Diff for: tests/test_highlevel.py

+2
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ def test_message_set_plain():
5959
message.set("centre", "ecmf")
6060
vals = np.arange(message.get("numberOfValues"), dtype=np.float32)
6161
message.set_array("values", vals)
62+
assert np.all(message.get("values") == vals)
63+
message.set("values", vals)
6264
message.set_missing(missing_key)
6365
assert message.get("centre") == "ecmf"
6466
assert np.all(message.get("values") == vals)

0 commit comments

Comments
 (0)