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’ll 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 1 commit
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
6 changes: 5 additions & 1 deletion .github/workflows/ci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,13 @@ 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.11"
session: "tests"
coverage: "--coverage"
- os: "ubuntu-latest"
python-version: "3.10"
session: "tests"
bjlittle marked this conversation as resolved.
Show resolved Hide resolved
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 @@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
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 @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
# importing anything else.
import iris.tests as tests # isort:skip

import sys
from xml.dom import minidom

import numpy as np
Expand Down Expand Up @@ -61,10 +62,14 @@ def test_indices(self):

def test_read_only(self):
attributes = ("indices", "cf_role", "start_index", "location_axis")
if sys.version_info.minor >= 11:
msg = "object has no setter"
else:
msg = "can't set attribute"
bjlittle marked this conversation as resolved.
Show resolved Hide resolved
for attribute in attributes:
self.assertRaisesRegex(
AttributeError,
"can't set attribute",
msg,
setattr,
self.connectivity,
attribute,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import iris.tests as tests # isort:skip

import re
import sys
import unittest.mock as mock

import dask.array as da
Expand Down Expand Up @@ -77,8 +78,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 sys.version_info.minor >= 11:
msg = "object has no setter"
else:
msg = "can't set"
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
Original file line number Diff line number Diff line change
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
41 changes: 13 additions & 28 deletions requirements/locks/py310-linux-64.lock

Large diffs are not rendered by default.

269 changes: 269 additions & 0 deletions requirements/locks/py311-linux-64.lock

Large diffs are not rendered by default.

43 changes: 14 additions & 29 deletions requirements/locks/py38-linux-64.lock

Large diffs are not rendered by default.

43 changes: 14 additions & 29 deletions requirements/locks/py39-linux-64.lock

Large diffs are not rendered by default.

56 changes: 56 additions & 0 deletions requirements/py311.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: iris-dev

channels:
- conda-forge

dependencies:
- python =3.11

# Setup dependencies.
- setuptools >=64
- setuptools-scm >=7

# Core dependencies.
- cartopy >=0.21
- cf-units >=3.1
- cftime >=1.5
- dask-core >=2022.9.0
- libnetcdf <4.9
- matplotlib >=3.5
- netcdf4
- numpy >=1.19
- python-xxhash
- pyproj
- scipy
- shapely !=1.8.3

# Optional dependencies.
- esmpy >=7.0
- graphviz
- iris-sample-data >=2.4.0
- mo_pack
- nc-time-axis >=1.4
- pandas
- pip
- python-stratify

# Test dependencies.
- filelock
- imagehash >=4.0
- pre-commit
- psutil
- pytest
- pytest-cov
- pytest-xdist
- requests

# Documentation dependencies.
- sphinx <=5.3
- sphinx-copybutton
- sphinx-gallery >=0.11.0
- sphinx-design
- pydata-sphinx-theme >=0.13.0

# Temporary minimum pins.
# See https://github.com/SciTools/iris/pull/5051
- graphviz >=6.0.0
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ classifiers =
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: Implementation :: CPython
Topic :: Scientific/Engineering
Topic :: Scientific/Engineering :: Atmospheric Science
Expand Down