Skip to content

Commit c9c20b1

Browse files
authored
Merge pull request #3190 from stfc/pi
Fix tests for compatibility with Python 3.14
2 parents 2f6bd75 + bee308f commit c9c20b1

File tree

9 files changed

+17
-11
lines changed

9 files changed

+17
-11
lines changed

.github/workflows/compilation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ env:
5858
NETCDF_FORTRAN_VERSION: 4.6
5959
NVFORTRAN_VERSION: 25.7
6060
OPENMPI_VERSION: 5.0
61-
PYTHON_VERSION: 3.13
61+
PYTHON_VERSION: 3.14
6262
NUM_PARALLEL: 16
6363

6464
jobs:

.github/workflows/extraction_test.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,8 @@ jobs:
122122
source /archive/psyclone-spack/psyclone-spack-Jun25/spack-repo/share/spack/setup-env.sh
123123
spack load lfric-build-environment%gcc@14
124124
source .runner_venv/bin/activate
125-
export LFRIC_DIR=/archive/psyclone-tests/latest-run/extraction/lfric_apps_${LFRIC_APPS_REV}
126-
export PSYCLONE_CONFIG_FILE=${PSYCLONE_LFRIC_DIR}/KGOs/lfric_psyclone.cfg
127125
export PSYCLONE_LFRIC_DIR=${GITHUB_WORKSPACE}/examples/lfric/scripts
126+
export PSYCLONE_CONFIG_FILE=${PSYCLONE_LFRIC_DIR}/KGOs/lfric_psyclone.cfg
128127
export COMPILER_PROFILE=fast-debug
129128
export NUM_PROCS=6
130129
export MAX_PROC=$((NUM_PROCS-1))

.github/workflows/lfric_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ on:
4444
env:
4545
LFRIC_APPS_REV: 10798
4646
LFRIC_CORE_REV: 52772
47-
PYTHON_VERSION: 3.13
47+
PYTHON_VERSION: 3.14
4848
GCC_VERSION: 14
4949
NVHPC_VERSION: 25.1
5050
NUM_PARALLEL: 16

.github/workflows/nemo_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ env:
4848
NVFORTRAN_VERSION: 25.7
4949
ONEAPI_VERSION: 2025.0
5050
PERL_VERSION: 5.42
51-
PYTHON_VERSION: 3.13
51+
PYTHON_VERSION: 3.14
5252
NUM_PARALLEL: 16
5353
PREFIX: /archive/psyclone-tests/latest-run/
5454

.github/workflows/python-package.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
- uses: actions/checkout@v4
6464
- uses: actions/setup-python@v5
6565
with:
66-
python-version: '3.13'
66+
python-version: '3.14'
6767
- run: sudo apt-get install -y graphviz doxygen
6868
- run: python -m pip install --upgrade pip
6969
- run: pip install .[doc]
@@ -77,7 +77,7 @@ jobs:
7777
runs-on: ubuntu-latest
7878
strategy:
7979
matrix:
80-
python-version: ['3.9', '3.13']
80+
python-version: ['3.9', '3.14']
8181
steps:
8282
- uses: actions/checkout@v4
8383
with:

changelog

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
8) PR #3190. Add python 3.14 in the CI and integration tests (except the
2+
LFRic Extraction tests).
3+
14
7) PR #3181 for #3173. Adds protections for CodeBlocks in the
25
DataSharingAttributeMixin.
36

doc/developer_guide/working_practises.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -493,13 +493,13 @@ computational cost (so that we 'fail fast'):
493493
3. All links within the Sphinx documentation (rst files) are checked (see
494494
note below);
495495

496-
4. All of the examples are tested (for Python versions 3.10 and 3.13)
496+
4. All of the examples are tested (for Python versions 3.9 and 3.14)
497497
using the ``Makefile`` in the ``examples`` directory. No compilation is
498498
performed; only the ``transform`` (performs the PSyclone transformations)
499499
and ``notebook`` (runs the various Jupyter notebooks) targets are used.
500500
The ``transform`` target is run 2-way parallel (``-j 2``).
501501

502-
5. The full test suite is run for Python versions 3.10 and 3.13 but
502+
5. The full test suite is run for Python versions 3.9 and 3.14 but
503503
without the compilation checks. ``pytest`` is passed the ``-n auto`` flag
504504
so that it will run the tests in parallel on as many cores as are
505505
available (currently 2 on GHA instances).

src/psyclone/tests/generator_test.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1408,7 +1408,10 @@ def test_main_unexpected_fatal_error(capsys, monkeypatch):
14081408
assert ("Error, unexpected exception, please report to the authors:"
14091409
in output)
14101410
assert "Traceback (most recent call last):" in output
1411-
assert "TypeError: argument of type 'int' is not iterable" in output
1411+
# Python >= 3.14 uses "is not a container or iterable",
1412+
# so we split the assertion for cross-version support
1413+
assert "TypeError: argument of type 'int' is not " in output
1414+
assert "iterable" in output
14121415

14131416

14141417
def test_main_fort_line_length_off(capsys):

src/psyclone/tests/utils_test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,4 +357,5 @@ def func(temp: bool, temp2: Union[bool, int]):
357357
# For second parameter temp2
358358
if "temp2" == k:
359359
anno = stringify_annotation(v.annotation)
360-
assert "typing.Union[bool, int]" == anno
360+
# Python >= 3.14 uses the second format
361+
assert "typing.Union[bool, int]" == anno or "bool | int" == anno

0 commit comments

Comments
 (0)