From 836a07fb84d97dfe8a5eb18cd07fc4cca572b748 Mon Sep 17 00:00:00 2001 From: Elias Sadek Date: Fri, 22 Sep 2023 11:36:44 +0100 Subject: [PATCH 1/4] removed pkg_resources version parse references --- docs/src/whatsnew/latest.rst | 5 +++-- .../tests/unit/experimental/ugrid/mesh/test_Connectivity.py | 4 ++-- .../tests/unit/experimental/ugrid/mesh/test_MeshCoord.py | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/docs/src/whatsnew/latest.rst b/docs/src/whatsnew/latest.rst index 4c732c43df..27d1734eaa 100644 --- a/docs/src/whatsnew/latest.rst +++ b/docs/src/whatsnew/latest.rst @@ -84,8 +84,9 @@ This document explains the changes made to Iris for this release working properly. (Main pull request: :pull:`5437`, more detail: :pull:`5430`, :pull:`5431`, :pull:`5432`, :pull:`5434`, :pull:`5436`) -#. `@acchamber`_ removed several warnings from iris related to Numpy 1.25 deprecations. - (:pull:`5493`) +#. `@acchamber`_ and `@ESadek-MO`_ resolved several deprecation to reduce + number of warnings raised during tests. + (:pull:`5493`, :pull:`5510`) #. `@trexfeathers`_ replaced all uses of the ``logging.WARNING`` level, in favour of using Python warnings, following team agreement. (:pull:`5488`) diff --git a/lib/iris/tests/unit/experimental/ugrid/mesh/test_Connectivity.py b/lib/iris/tests/unit/experimental/ugrid/mesh/test_Connectivity.py index f343f4be24..7e90555801 100644 --- a/lib/iris/tests/unit/experimental/ugrid/mesh/test_Connectivity.py +++ b/lib/iris/tests/unit/experimental/ugrid/mesh/test_Connectivity.py @@ -14,7 +14,7 @@ import numpy as np from numpy import ma -from pkg_resources import parse_version +from packaging import version from iris._lazy_data import as_lazy_data, is_lazy_data from iris.experimental.ugrid.mesh import Connectivity @@ -63,7 +63,7 @@ def test_indices(self): def test_read_only(self): attributes = ("indices", "cf_role", "start_index", "location_axis") - if parse_version(python_version()) >= parse_version("3.11"): + if version.parse(python_version()) >= version.parse("3.11"): msg = "object has no setter" else: msg = "can't set attribute" diff --git a/lib/iris/tests/unit/experimental/ugrid/mesh/test_MeshCoord.py b/lib/iris/tests/unit/experimental/ugrid/mesh/test_MeshCoord.py index cb90c176b6..ba7306bded 100644 --- a/lib/iris/tests/unit/experimental/ugrid/mesh/test_MeshCoord.py +++ b/lib/iris/tests/unit/experimental/ugrid/mesh/test_MeshCoord.py @@ -17,7 +17,7 @@ import dask.array as da import numpy as np -from pkg_resources import parse_version +from packaging import version import pytest from iris._lazy_data import as_lazy_data, is_lazy_data @@ -79,7 +79,7 @@ def setUp(self): def test_fixed_metadata(self): # Check that you cannot set any of these on an existing MeshCoord. meshcoord = self.meshcoord - if parse_version(python_version()) >= parse_version("3.11"): + if version.parse(python_version()) >= version.parse("3.11"): msg = "object has no setter" else: msg = "can't set attribute" From 063dc889dd8c6e74871f48d50d403276e162f212 Mon Sep 17 00:00:00 2001 From: Elias <110238618+ESadek-MO@users.noreply.github.com> Date: Fri, 22 Sep 2023 11:40:10 +0100 Subject: [PATCH 2/4] Corrected pull num --- docs/src/whatsnew/latest.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/whatsnew/latest.rst b/docs/src/whatsnew/latest.rst index 27d1734eaa..6fc300b364 100644 --- a/docs/src/whatsnew/latest.rst +++ b/docs/src/whatsnew/latest.rst @@ -86,7 +86,7 @@ This document explains the changes made to Iris for this release #. `@acchamber`_ and `@ESadek-MO`_ resolved several deprecation to reduce number of warnings raised during tests. - (:pull:`5493`, :pull:`5510`) + (:pull:`5493`, :pull:`5511`) #. `@trexfeathers`_ replaced all uses of the ``logging.WARNING`` level, in favour of using Python warnings, following team agreement. (:pull:`5488`) From 872389ec56d55218d3fa71f8e3f14b0b73ae08fa Mon Sep 17 00:00:00 2001 From: Martin Yeo <40734014+trexfeathers@users.noreply.github.com> Date: Fri, 22 Sep 2023 12:31:33 +0100 Subject: [PATCH 3/4] Fix What's New indentation --- docs/src/whatsnew/latest.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/whatsnew/latest.rst b/docs/src/whatsnew/latest.rst index 6fc300b364..38cc910d86 100644 --- a/docs/src/whatsnew/latest.rst +++ b/docs/src/whatsnew/latest.rst @@ -86,7 +86,7 @@ This document explains the changes made to Iris for this release #. `@acchamber`_ and `@ESadek-MO`_ resolved several deprecation to reduce number of warnings raised during tests. - (:pull:`5493`, :pull:`5511`) + (:pull:`5493`, :pull:`5511`) #. `@trexfeathers`_ replaced all uses of the ``logging.WARNING`` level, in favour of using Python warnings, following team agreement. (:pull:`5488`) From 72450c77d20383e737a6ffc5c198bd8f6077bc9c Mon Sep 17 00:00:00 2001 From: Martin Yeo <40734014+trexfeathers@users.noreply.github.com> Date: Fri, 22 Sep 2023 12:44:23 +0100 Subject: [PATCH 4/4] Fix What's New indentation. --- docs/src/whatsnew/latest.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/src/whatsnew/latest.rst b/docs/src/whatsnew/latest.rst index 38cc910d86..b342a51a01 100644 --- a/docs/src/whatsnew/latest.rst +++ b/docs/src/whatsnew/latest.rst @@ -85,8 +85,8 @@ This document explains the changes made to Iris for this release :pull:`5430`, :pull:`5431`, :pull:`5432`, :pull:`5434`, :pull:`5436`) #. `@acchamber`_ and `@ESadek-MO`_ resolved several deprecation to reduce - number of warnings raised during tests. - (:pull:`5493`, :pull:`5511`) + number of warnings raised during tests. + (:pull:`5493`, :pull:`5511`) #. `@trexfeathers`_ replaced all uses of the ``logging.WARNING`` level, in favour of using Python warnings, following team agreement. (:pull:`5488`)