diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index 05c0789..41225f9 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -17,15 +17,14 @@ 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)" - 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 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 diff --git a/.github/workflows/test_with_pytest.yml b/.github/workflows/test_with_pytest.yml index 3a1def7..a0509d0 100644 --- a/.github/workflows/test_with_pytest.yml +++ b/.github/workflows/test_with_pytest.yml @@ -7,10 +7,13 @@ 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.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 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_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 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 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",