Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/ci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,18 @@ jobs:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.12"]
python-version: ["3.13"]
session: ["doctest", "gallery", "linkcheck"]
include:
- os: "ubuntu-latest"
python-version: "3.12"
python-version: "3.13"
session: "tests"
coverage: "--coverage"
- os: "ubuntu-latest"
python-version: "3.11"
python-version: "3.12"
session: "tests"
- os: "ubuntu-latest"
python-version: "3.10"
python-version: "3.11"
session: "tests"

env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]
python-version: ["3.11", "3.12", "3.13"]
session: ["wheel"]
env:
ENV_NAME: "ci-wheels"
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/bm_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def _check_requirements(package: str) -> None:

def _prep_data_gen_env() -> None:
"""Create or access a separate, unchanging environment for generating test data."""
python_version = "3.12"
python_version = "3.13"
data_gen_var = "DATA_GEN_PYTHON"
if data_gen_var in environ:
echo("Using existing data generation environment.")
Expand Down
6 changes: 4 additions & 2 deletions docs/src/whatsnew/latest.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ This document explains the changes made to Iris for this release
🔗 Dependencies
===============

#. N/A

#. `@stephenworsley`_ dropped support for ``py310`` and adopted support for ``py313``
as per the `SPEC 0`_ schedule. (:pull:`6195`)

📚 Documentation
================
Expand Down Expand Up @@ -125,3 +125,5 @@ This document explains the changes made to Iris for this release

.. comment
Whatsnew resources in alphabetical order:

.. _SPEC 0: https://scientific-python.org/specs/spec-0000/
4 changes: 2 additions & 2 deletions lib/iris/cube.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def xml(self, checksum=False, order=True, byteorder=True):

# return our newly created XML string
doc = Cube._sort_xml_attrs(doc)
return doc.toprettyxml(indent=" ")
return iris.util._print_xml(doc)

def extract(self, constraints):
"""Filter each of the cubes which can be filtered by the given constraints.
Expand Down Expand Up @@ -3782,7 +3782,7 @@ def xml(

# Print our newly created XML
doc = self._sort_xml_attrs(doc)
return doc.toprettyxml(indent=" ")
return iris.util._print_xml(doc)

def _xml_element(self, doc, checksum=False, order=True, byteorder=True):
cube_xml_element = doc.createElement("cube")
Expand Down
2 changes: 1 addition & 1 deletion lib/iris/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ def assertXMLElement(self, obj, reference_filename):
# this is to be compatible with stored test output where xml attrs are stored in alphabetical order,
# (which was default behaviour in python <3.8, but changed to insert order in >3.8)
doc = iris.cube.Cube._sort_xml_attrs(doc)
pretty_xml = doc.toprettyxml(indent=" ")
pretty_xml = iris.util._print_xml(doc)
reference_path = self.get_result_path(reference_filename)
self._check_same(pretty_xml, reference_path, type_comparison_name="XML")

Expand Down
2 changes: 1 addition & 1 deletion lib/iris/tests/_shared_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ def assert_XML_element(obj, reference_filename):
# this is to be compatible with stored test output where xml attrs are stored in alphabetical order,
# (which was default behaviour in python <3.8, but changed to insert order in >3.8)
doc = iris.cube.Cube._sort_xml_attrs(doc)
pretty_xml = doc.toprettyxml(indent=" ")
pretty_xml = iris.util._print_xml(doc)
reference_path = get_result_path(reference_filename)
_check_same(pretty_xml, reference_path, type_comparison_name="XML")

Expand Down
4 changes: 2 additions & 2 deletions lib/iris/tests/test_coding_standards.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ def test_python_versions():
Test is designed to fail whenever Iris' supported Python versions are
updated, insisting that versions are updated EVERYWHERE in-sync.
"""
latest_supported = "3.12"
all_supported = ["3.10", "3.11", latest_supported]
latest_supported = "3.13"
all_supported = ["3.11", "3.12", latest_supported]

root_dir = Path(__file__).parents[3]
workflows_dir = root_dir / ".github" / "workflows"
Expand Down
10 changes: 5 additions & 5 deletions lib/iris/tests/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,9 @@ def test_output_file(self, tmp_path):
test_cube_a.standard_name = "relative_humidity"
test_cube_a.units = cf_units.Unit("m")

with tmp_path / "tmp" as filename:
with open(filename, "w") as f:
iris.util.describe_diff(test_cube_a, test_cube_b, output_file=f)
f.close()
filename = tmp_path / "tmp"
with open(filename, "w") as f:
iris.util.describe_diff(test_cube_a, test_cube_b, output_file=f)
f.close()

_shared_utils.assert_files_equal(filename, "incompatible_cubes.str.txt")
_shared_utils.assert_files_equal(filename, "incompatible_cubes.str.txt")
23 changes: 23 additions & 0 deletions lib/iris/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -2320,3 +2320,26 @@ def equalise_cubes(
# Return a CubeList result = the *original* cubes, as modified
result = CubeList(cubes)
return result


def _print_xml(doc):
"""Print xml in a standard fashion.

Modifies :meth: `xml.dom.minidom.Document.toprettyxml` to maintain backwards
compatibilitiy with the way Iris expects arrays to be represented. Changes to
xml introduced with https://github.com/python/cpython/pull/107947 mean that
newlines in attributes are escaped by default. This reverts to the old behaviour
by replacing the escaped newlines with proper newlines.

Parameters
----------
doc : :class: `xml.dom.minidom.Document`
The xml document to be printed.

Returns
-------
str
Standard string representation of xml document.
"""
result = doc.toprettyxml(indent=" ")
return result.replace("&#10;", "\n")
2 changes: 1 addition & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
nox.options.reuse_existing_virtualenvs = True

#: Python versions we can run sessions under
_PY_VERSIONS_ALL = ["3.10", "3.11", "3.12"]
_PY_VERSIONS_ALL = ["3.11", "3.12", "3.13"]
_PY_VERSION_LATEST = _PY_VERSIONS_ALL[-1]

#: One specific python version for docs builds
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ classifiers = [
"Operating System :: Unix",
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Atmospheric Science",
Expand All @@ -50,7 +50,7 @@ keywords = [
]
license = {text = "BSD-3-Clause"}
name = "scitools-iris"
requires-python = ">=3.10"
requires-python = ">=3.11"

[project.urls]
Code = "https://github.com/SciTools/iris"
Expand Down
Loading
Loading