Skip to content

Commit

Permalink
drop py36 support (#4163)
Browse files Browse the repository at this point in the history
* drop py36 support

* add a whatsnew entry

* review actions

* warn assert oddness on ci

* update pyproject.toml

* remove py36-linux-64.lock file
  • Loading branch information
bjlittle authored Jun 2, 2021
1 parent 894f363 commit 64c88c8
Show file tree
Hide file tree
Showing 11 changed files with 48 additions and 312 deletions.
4 changes: 0 additions & 4 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,6 @@ test_minimal_task:
only_if: ${SKIP_TEST_MINIMAL_TASK} == "" && ${SKIP_ALL_TEST_TASKS} == ""
<< : *CREDITS_TEMPLATE
matrix:
env:
PY_VER: 3.6
env:
PY_VER: 3.7
env:
Expand All @@ -159,8 +157,6 @@ test_full_task:
only_if: ${SKIP_TEST_FULL_TASK} == "" && ${SKIP_ALL_TEST_TASKS} == ""
<< : *CREDITS_TEMPLATE
matrix:
env:
PY_VER: 3.6
env:
PY_VER: 3.7
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/refresh-lockfiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:

strategy:
matrix:
python: ['36', '37', '38']
python: ['37', '38']

steps:
- uses: actions/checkout@v2
Expand Down
37 changes: 32 additions & 5 deletions docs/src/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,15 @@

# ----------------------------------------------------------------------------

import datetime
import ntpath
import os
from pathlib import Path
import re
import sys
import warnings

import iris


# function to write useful output to stdout, prefixing the source.
Expand Down Expand Up @@ -53,9 +59,6 @@ def autolog(message):
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.

import datetime
import warnings

# custom sphinx extensions
sys.path.append(os.path.abspath("sphinxext"))

Expand All @@ -80,8 +83,6 @@ def autolog(message):
# |version| and |release|, also used in various other places throughout the
# built documents.

import iris

# The short X.Y version.
if iris.__version__ == "dev":
version = "dev"
Expand All @@ -101,9 +102,35 @@ def autolog(message):

build_python_version = ".".join([str(i) for i in sys.version_info[:3]])


def _dotv(version):
result = version
match = re.match(r"^py(\d+)$", version)
if match:
digits = match.group(1)
if len(digits) > 1:
result = f"{digits[0]}.{digits[1:]}"
return result


# Automate the discovery of the python versions tested with CI.
python_support = sorted(
[fname.stem for fname in Path(".").glob("../../requirements/ci/py*.yml")]
)

if not python_support:
python_support = "unknown Python versions"
elif len(python_support) == 1:
python_support = f"Python {_dotv(python_support[0])}"
else:
rest = ", ".join([_dotv(v) for v in python_support[:-1]])
last = _dotv(python_support[-1])
python_support = f"Python {rest} and {last}"

rst_epilog = f"""
.. |copyright_years| replace:: {copyright_years}
.. |python_version| replace:: {build_python_version}
.. |python_support| replace:: {python_support}
.. |iris_version| replace:: v{version}
.. |build_date| replace:: ({datetime.datetime.now().strftime('%d %b %Y')})
"""
Expand Down
3 changes: 1 addition & 2 deletions docs/src/installing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ any WSL_ distributions.

.. _WSL: https://docs.microsoft.com/en-us/windows/wsl/install-win10

.. note:: Iris is currently supported and tested against Python ``3.6``,
``3.7``, and ``3.8``.
.. note:: Iris is currently supported and tested against |python_support|.

.. note:: This documentation was built using Python |python_version|.

Expand Down
14 changes: 10 additions & 4 deletions docs/src/whatsnew/latest.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ This document explains the changes made to Iris for this release
:title: text-primary text-center font-weight-bold
:body: bg-light
:animate: fade-in
:open:

The highlights for this major/minor release of Iris include:
The highlights for this minor release of Iris include:

* N/A
* We've dropped support for `Python 3.6`_

And finally, get in touch with us on `GitHub`_ if you have any issues or
feature requests for improving Iris. Enjoy!
Expand All @@ -27,8 +28,8 @@ This document explains the changes made to Iris for this release
#. Congratulations to `@jamesp`_ who recently became an Iris core developer
after joining the Iris development team at the `Met Office`_. 🎉

#. A special thanks goes to `@akuhnregnier`_, `@gcaria`_, `@jamesp`_ and
`@MHBalsmeier`_ all of whom made their first contributions to Iris, which
#. A special thanks goes to `@akuhnregnier`_, `@gcaria`_, `@jamesp`_, `@MHBalsmeier`_
and `@Badboy-16`_ all of whom made their first contributions to Iris, which
were gratefully received and included in this release. Keep up the awesome
work! 🍻

Expand Down Expand Up @@ -168,6 +169,10 @@ This document explains the changes made to Iris for this release
templates to remove an external URL reference that caused un-posted user issue
content to be lost in the browser when followed. (:pull:`4147`)

#. `@bjlittle`_ dropped `Python 3.6`_ support, and automated the discovery of
supported Python versions tested by `cirrus-ci`_ for documentation.
(:pull:`4163`)

.. comment
Whatsnew author names (@github name) in alphabetical order. Note that,
core dev names are automatically included by the common_links.inc:
Expand All @@ -191,6 +196,7 @@ This document explains the changes made to Iris for this release
.. |PyPI| image:: https://img.shields.io/pypi/v/scitools-iris?color=orange&label=pypi%7Cscitools-iris
.. _PyPI: https://pypi.org/project/scitools-iris/
.. _Python 3.8: https://www.python.org/downloads/release/python-380/
.. _Python 3.6: https://www.python.org/downloads/release/python-360/
.. _README.md: https://github.com/SciTools/iris#-----
.. _xxhash: http://cyan4973.github.io/xxHash/
.. _conda-lock: https://github.com/conda-incubator/conda-lock
2 changes: 1 addition & 1 deletion lib/iris/tests/integration/test_pp.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ def test_hybrid_height_round_trip_no_reference(self):
"Unable to create instance of HybridHeightFactory. "
"The source data contains no field(s) for 'orography'."
)
warn.assert_called_once_with(msg)
warn.assert_called_with(msg)

# Check the data cube is set up to use hybrid height.
self._test_coord(
Expand Down
2 changes: 1 addition & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
PACKAGE = str("lib" / Path("iris"))

#: Cirrus-CI environment variable hook.
PY_VER = os.environ.get("PY_VER", ["3.6", "3.7", "3.8"])
PY_VER = os.environ.get("PY_VER", ["3.7", "3.8"])

#: Default cartopy cache directory.
CARTOPY_CACHE_DIR = os.environ.get("HOME") / Path(".local/share/cartopy")
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.black]
line-length = 79
target-version = ['py36', 'py37', 'py38']
target-version = ['py37', 'py38']
include = '\.pyi?$'
exclude = '''
Expand Down
Loading

0 comments on commit 64c88c8

Please sign in to comment.