From 60862a56aec27151085fde11ddf22bd673d0cb7c Mon Sep 17 00:00:00 2001 From: Louwrens van Dellen Date: Fri, 27 Nov 2026 06:09:21 +0100 Subject: [PATCH 1/7] bugfix: zip(..., strict=True) fails on py39 the argument was also useless: ip and method are made to be equal in length in previous statement --- imas/ids_convert.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imas/ids_convert.py b/imas/ids_convert.py index a14f154..5aecd9f 100644 --- a/imas/ids_convert.py +++ b/imas/ids_convert.py @@ -1344,7 +1344,7 @@ def _magnetics_method_to_ip(method: IDSBase, ip: IDSBase) -> None: if not len(method): return ip.resize(len(method)) - for old_item, new_item in zip(method, ip, strict=True): + for old_item, new_item in zip(method, ip): new_item.method_name.value = old_item.name.value new_item.data.value = old_item.ip.data.value new_item.time.value = old_item.ip.time.value From a32332a4441c833033c1fcb57a8d7945b79495b7 Mon Sep 17 00:00:00 2001 From: Louwrens van Dellen Date: Fri, 27 Nov 2026 06:15:35 +0100 Subject: [PATCH 2/7] ci: build wheels with newest python, linting with oldest Build wheels with newest python build toolchain to catch novel build errors. BTW, saxonche is available on 3.14 and 3.15. Linting with oldest python supported to catch syntax errors not yet supported. --- .github/workflows/linting.yml | 5 ++--- .github/workflows/publish.yml | 4 +--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index 05c0789..7cc5ff8 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -17,9 +17,8 @@ jobs: - name: Set up Python uses: actions/setup-python@v7 with: - # until saxonche is available in 3.13 - # https://saxonica.plan.io/issues/6561 - python-version: "<3.13" + # choose lowest python version supported to reject syntax it cannot handle yet + python-version: "3.9" - name: Display Python version run: python -c "import sys; print(sys.version)" diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index a34f7a5..64399fc 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -16,9 +16,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v7 with: - # until saxonche is available in 3.13 - # https://saxonica.plan.io/issues/6561 - python-version: "<3.13" + python-version: "3.15" - name: Install pypa/build run: >- python3 -m pip install pip setuptools wheel build From 064e326c4dccff47ce6baaebd568794ddafb2e44 Mon Sep 17 00:00:00 2001 From: Louwrens van Dellen Date: Fri, 27 Nov 2026 06:16:24 +0100 Subject: [PATCH 3/7] ci: expand pytest to python 3.9...3.15 --- .github/workflows/test_with_pytest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_with_pytest.yml b/.github/workflows/test_with_pytest.yml index 3a1def7..32aa97b 100644 --- a/.github/workflows/test_with_pytest.yml +++ b/.github/workflows/test_with_pytest.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.10", "3.11", "3.12", "3.13"] # Test on multiple Python versions + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14", "3.15"] # Test on multiple Python versions steps: - name: Checkout repository From 3f88a8ab1b4c300c894650c40ef248f4b685b23d Mon Sep 17 00:00:00 2001 From: Louwrens van Dellen Date: Fri, 27 Nov 2026 06:27:13 +0100 Subject: [PATCH 4/7] project.toml: requires-python >=3.9 drop unused numpy from build-system simplify clasifiers to Python :: 3 --- pyproject.toml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 55c860b..96c7bf4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [build-system] # Minimum requirements for the build system to execute. # Keep this on a single line for the grep magic of build scripts to work -requires = ["setuptools>=61", "wheel", "numpy", "packaging", "tomli;python_version<'3.11'", "setuptools_scm>8"] +requires = ["setuptools>=61", "wheel", "packaging", "tomli;python_version<'3.11'", "setuptools_scm>8"] build-backend = "setuptools.build_meta" @@ -16,7 +16,7 @@ authors = [ ] description = "Pythonic wrappers for the IMAS Access Layer" readme = {file = "README.md", content-type = "text/markdown"} -requires-python = ">=3.7" +requires-python = ">=3.9" license = {file = "LICENSE.txt"} classifiers = [ "Development Status :: 5 - Production/Stable", @@ -40,8 +40,6 @@ classifiers = [ "Operating System :: POSIX :: Linux", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", "Programming Language :: Unix Shell", "Topic :: Database", "Topic :: Database :: Front-Ends", @@ -60,7 +58,6 @@ dependencies = [ "rich", "scipy", "click", - "importlib_resources;python_version<'3.9'", "packaging", "xxhash >= 2", "imas_data_dictionaries>=4.1.0", From c11df0aa2c3a77e4a1060d9fceb8fbde0dcbc3ea Mon Sep 17 00:00:00 2001 From: Louwrens van Dellen Date: Fri, 27 Nov 2026 06:58:27 +0100 Subject: [PATCH 5/7] ci: linting with final Black that is py39 compatible --- .github/workflows/linting.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index 7cc5ff8..41225f9 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -24,7 +24,7 @@ jobs: run: python -c "import sys; print(sys.version)" - name: Install the code linting and formatting tools - run: pip install --upgrade 'black >=24,<25' flake8 + run: pip install --upgrade 'black >=25,<26' flake8 - name: Check formatting of code with black run: black --check imas From 7b1dedaebdfcbb6f8e224a30b9d9ee3ac2c4f122 Mon Sep 17 00:00:00 2001 From: Louwrens van Dellen Date: Fri, 27 Nov 2026 06:58:40 +0100 Subject: [PATCH 6/7] black: cosmetic changes --- imas/backends/imas_core/__init__.py | 3 +-- imas/backends/imas_core/db_entry_helpers.py | 3 +-- imas/backends/netcdf/__init__.py | 3 +-- imas/ids_data_type.py | 3 +-- imas/ids_defs.py | 2 +- imas/ids_path.py | 3 +-- imas/ids_primitive.py | 3 +-- imas/ids_struct_array.py | 3 +-- imas/setup_logging.py | 3 +-- imas/test/test_latest_dd_resample.py | 3 +-- imas/test/test_minimal_types_io_automatic.py | 3 +-- 11 files changed, 11 insertions(+), 21 deletions(-) diff --git a/imas/backends/imas_core/__init__.py b/imas/backends/imas_core/__init__.py index 14b3a76..01d8ab6 100644 --- a/imas/backends/imas_core/__init__.py +++ b/imas/backends/imas_core/__init__.py @@ -1,4 +1,3 @@ # This file is part of IMAS-Python. # You should have received the IMAS-Python LICENSE file with this project. -"""Subpackage implementing data access through the IMAS Access Layer Core. -""" +"""Subpackage implementing data access through the IMAS Access Layer Core.""" diff --git a/imas/backends/imas_core/db_entry_helpers.py b/imas/backends/imas_core/db_entry_helpers.py index f83a0d4..65aefe5 100644 --- a/imas/backends/imas_core/db_entry_helpers.py +++ b/imas/backends/imas_core/db_entry_helpers.py @@ -1,7 +1,6 @@ # This file is part of IMAS-Python. # You should have received the IMAS-Python LICENSE file with this project. -"""Helper methods for loading data from and storing data to Data Entries. -""" +"""Helper methods for loading data from and storing data to Data Entries.""" from typing import Optional diff --git a/imas/backends/netcdf/__init__.py b/imas/backends/netcdf/__init__.py index b4fd429..8ea77be 100644 --- a/imas/backends/netcdf/__init__.py +++ b/imas/backends/netcdf/__init__.py @@ -1,4 +1,3 @@ # This file is part of IMAS-Python. # You should have received the IMAS-Python LICENSE file with this project. -"""NetCDF IO support for IMAS-Python. Requires [netcdf] extra dependencies. -""" +"""NetCDF IO support for IMAS-Python. Requires [netcdf] extra dependencies.""" diff --git a/imas/ids_data_type.py b/imas/ids_data_type.py index 50f6f80..6b63acf 100644 --- a/imas/ids_data_type.py +++ b/imas/ids_data_type.py @@ -1,7 +1,6 @@ # This file is part of IMAS-Python. # You should have received the IMAS-Python LICENSE file with this project. -"""Data Dictionary type handling functionality. -""" +"""Data Dictionary type handling functionality.""" from enum import Enum from functools import lru_cache diff --git a/imas/ids_defs.py b/imas/ids_defs.py index 3ac3c6b..9c5eb48 100644 --- a/imas/ids_defs.py +++ b/imas/ids_defs.py @@ -1,6 +1,6 @@ # This file is part of IMAS-Python. # You should have received the IMAS-Python LICENSE file with this project. -""" Load IMAS-Python libs to provide constants +"""Load IMAS-Python libs to provide constants .. _`Backend identifiers`: diff --git a/imas/ids_path.py b/imas/ids_path.py index 97f9b69..f3cd774 100644 --- a/imas/ids_path.py +++ b/imas/ids_path.py @@ -1,7 +1,6 @@ # This file is part of IMAS-Python. # You should have received the IMAS-Python LICENSE file with this project. -"""Logic for interpreting paths to elements in an IDS -""" +"""Logic for interpreting paths to elements in an IDS""" import logging import re diff --git a/imas/ids_primitive.py b/imas/ids_primitive.py index 4843ca0..30afa4d 100644 --- a/imas/ids_primitive.py +++ b/imas/ids_primitive.py @@ -1,7 +1,6 @@ # This file is part of IMAS-Python. # You should have received the IMAS-Python LICENSE file with this project. -"""Provides the classes for IDS data nodes -""" +"""Provides the classes for IDS data nodes""" import logging import math import operator diff --git a/imas/ids_struct_array.py b/imas/ids_struct_array.py index b176864..dea53b9 100644 --- a/imas/ids_struct_array.py +++ b/imas/ids_struct_array.py @@ -1,7 +1,6 @@ # This file is part of IMAS-Python. # You should have received the IMAS-Python LICENSE file with this project. -"""IDS StructArray represents an Array of Structures in the IDS tree. -""" +"""IDS StructArray represents an Array of Structures in the IDS tree.""" import logging from copy import deepcopy diff --git a/imas/setup_logging.py b/imas/setup_logging.py index 4ec3a34..90faf0b 100644 --- a/imas/setup_logging.py +++ b/imas/setup_logging.py @@ -1,7 +1,6 @@ # This file is part of IMAS-Python. # You should have received the IMAS-Python LICENSE file with this project. -"""Create a default log handler when IMAS-Python is imported. -""" +"""Create a default log handler when IMAS-Python is imported.""" import logging import os diff --git a/imas/test/test_latest_dd_resample.py b/imas/test/test_latest_dd_resample.py index a4ea7f7..97c6843 100644 --- a/imas/test/test_latest_dd_resample.py +++ b/imas/test/test_latest_dd_resample.py @@ -1,5 +1,4 @@ -"""A testcase checking if resampling works for the latest data dictionary version. -""" +"""A testcase checking if resampling works for the latest data dictionary version.""" import numpy as np diff --git a/imas/test/test_minimal_types_io_automatic.py b/imas/test/test_minimal_types_io_automatic.py index 0a2a5ba..446f931 100644 --- a/imas/test/test_minimal_types_io_automatic.py +++ b/imas/test/test_minimal_types_io_automatic.py @@ -1,5 +1,4 @@ -"""A minimal testcase loading an IDS file and checking that the structure built is ok -""" +"""A minimal testcase loading an IDS file and checking that the structure built is ok""" import numpy as np From 84a957533f064103302fb90ec65b7916ca6a5183 Mon Sep 17 00:00:00 2001 From: Louwrens van Dellen Date: Fri, 27 Nov 2026 07:19:29 +0100 Subject: [PATCH 7/7] ci: bugfix no python 3.9 build for ubuntu-26.04 --- .github/workflows/test_with_pytest.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test_with_pytest.yml b/.github/workflows/test_with_pytest.yml index 32aa97b..a0509d0 100644 --- a/.github/workflows/test_with_pytest.yml +++ b/.github/workflows/test_with_pytest.yml @@ -7,8 +7,11 @@ on: jobs: test: - runs-on: ubuntu-latest + # setup-python has no 3.9 build for ubuntu-26.04 (which ubuntu-latest now resolves to); + # 24.04 has builds for every version in the matrix + runs-on: ubuntu-24.04 strategy: + fail-fast: false matrix: python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14", "3.15"] # Test on multiple Python versions