Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Python 3.11 #5226

Merged
merged 2 commits into from Apr 21, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/ci-tests.yml
Expand Up @@ -35,13 +35,16 @@ jobs:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.10"]
python-version: ["3.11"]
session: ["doctest", "gallery", "linkcheck"]
include:
- os: "ubuntu-latest"
python-version: "3.10"
python-version: "3.11"
session: "tests"
coverage: "--coverage"
- os: "ubuntu-latest"
python-version: "3.10"
session: "tests"
bjlittle marked this conversation as resolved.
Show resolved Hide resolved
- os: "ubuntu-latest"
python-version: "3.9"
session: "tests"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-wheels.yml
Expand Up @@ -54,7 +54,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10"]
python-version: ["3.8", "3.9", "3.10", "3.11"]
session: ["wheel"]
env:
ENV_NAME: "ci-wheels"
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/asv.conf.json
Expand Up @@ -19,7 +19,7 @@
// * No build-time environment variables.
// * Is run in the same environment as the ASV install itself.
"delegated_env_commands": [
"PY_VER=3.10 nox --envdir={conf_dir}/.asv/env/nox01 --session=tests --install-only --no-error-on-external-run --verbose"
"PY_VER=3.11 nox --envdir={conf_dir}/.asv/env/nox01 --session=tests --install-only --no-error-on-external-run --verbose"
],
// The parent directory of the above environment.
// The most recently modified environment in the directory will be used.
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/bm_runner.py
Expand Up @@ -60,7 +60,7 @@ def _prep_data_gen_env() -> None:
"""

root_dir = BENCHMARKS_DIR.parent
python_version = "3.10"
python_version = "3.11"
data_gen_var = "DATA_GEN_PYTHON"
if data_gen_var in environ:
print("Using existing data generation environment.")
Expand Down
3 changes: 2 additions & 1 deletion docs/src/whatsnew/latest.rst
Expand Up @@ -60,7 +60,8 @@ This document explains the changes made to Iris for this release
馃敆 Dependencies
===============

#. N/A
#. `@rcomer`_ and `@bjlittle`_ (reviewer) added testing support for python
3.11. (:pull:`5226`)


馃摎 Documentation
Expand Down
4 changes: 2 additions & 2 deletions lib/iris/tests/test_coding_standards.py
Expand Up @@ -71,8 +71,8 @@ def test_python_versions():
This test is designed to fail whenever Iris' supported Python versions are
updated, insisting that versions are updated EVERYWHERE in-sync.
"""
latest_supported = "3.10"
all_supported = ["3.8", "3.9", latest_supported]
latest_supported = "3.11"
all_supported = ["3.8", "3.9", "3.10", latest_supported]

root_dir = Path(__file__).parents[3]
workflows_dir = root_dir / ".github" / "workflows"
Expand Down
Expand Up @@ -9,10 +9,12 @@
# importing anything else.
import iris.tests as tests # isort:skip

from platform import python_version
from xml.dom import minidom

import numpy as np
from numpy import ma
from pkg_resources import parse_version

from iris._lazy_data import as_lazy_data, is_lazy_data
from iris.experimental.ugrid.mesh import Connectivity
Expand Down Expand Up @@ -61,10 +63,14 @@ 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"):
msg = "object has no setter"
else:
msg = "can't set attribute"
for attribute in attributes:
self.assertRaisesRegex(
AttributeError,
"can't set attribute",
msg,
setattr,
self.connectivity,
attribute,
Expand Down
Expand Up @@ -11,11 +11,13 @@
# importing anything else.
import iris.tests as tests # isort:skip

from platform import python_version
import re
import unittest.mock as mock

import dask.array as da
import numpy as np
from pkg_resources import parse_version
import pytest

from iris._lazy_data import as_lazy_data, is_lazy_data
Expand Down Expand Up @@ -77,8 +79,12 @@ 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"):
msg = "object has no setter"
else:
msg = "can't set attribute"
for prop in ("mesh", "location", "axis"):
with self.assertRaisesRegex(AttributeError, "can't set"):
with self.assertRaisesRegex(AttributeError, msg):
setattr(meshcoord, prop, mock.sentinel.odd)

def test_coord_system(self):
Expand Down
2 changes: 1 addition & 1 deletion noxfile.py
Expand Up @@ -16,7 +16,7 @@
nox.options.reuse_existing_virtualenvs = True

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

#: One specific python version for docs builds
Expand Down
2 changes: 1 addition & 1 deletion requirements/iris.yml