Skip to content
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
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
36 changes: 31 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,34 @@ def autolog(message):

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


def _dotv(version):
result = version
match = re.match("^py(\d+)$", version) # noqa: W605
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be a raw string instead of overriding the linter?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done 👍

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 = [
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
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"])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could /should this use the same discovery code that you've written for the docs?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What we're actually testing in nox is not a specific version of python, but a specific environment that is defined by a yaml file in requirements/ci.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm I'll give it a try and see what it looks like... the hardest part is deciding on where such common code will live.

But yeah, that would be a nice win 👍

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bjlittle I'm happy for this to go in as-is with your latest updates. Let me know if you plan to rework otherwise I'm merging today

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jamesp Okay, so I gave this a reasonably punt... but you swiftly run into a bit of a pickle as everything under the requirements directory isn't installed as a package, so you can't really safely reference it from nox or the docs without jumping through some hoops.

It is possible, and I suspect we'd either want to re-structure our resources or use setuptools sub-packages to do that properly... but I'm not really inclined to pursue this ATM, unless you want me to follow through on this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm surprised this is an issue. Sure, we run our tests on a installed instance of Iris, so there are concerns on inclusion/exclusion there. But as far as I was aware Nox was expected to operate on a checkout of a repo, rather than within an install. Indeed I've based a few things on this assumption.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, you must be referencing requirements somewhere from nox as those environments yamls are being read to create the test envs. But I think I understand your point to be that the introspection bit of nox where it works out what sessions it has might not be able to safely operate. either way though, nox isn't going to work if the requirements/ci folder isn't there.

This isn't a big issue, happy to leave it hard coded.

Copy link
Member Author

@bjlittle bjlittle Jun 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to be clear... the issue isn't about whether the directory exists, per se... rather that I was attempting to bank common code under requirements/__init__.py for both the docs and nox to use - that's the problem here.

The simple alternative is to put common code within iris (which I really don't want to do) or I duplicate the code within the noxfile and within the docs, or we have a subpackage for iris.... or some other option.

So it's do-able, just whatever you prefer... if you want to follow-thru with this

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either way, I don't think this should be a blocker for this PR. We can happily bank this PR "as is", and iterate on this later.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, for me this is all becoming a bit of a moot point, as a developer still requires to manually update the matrix for the minimal and full tests.


#: Default cartopy cache directory.
CARTOPY_CACHE_DIR = os.environ.get("HOME") / Path(".local/share/cartopy")
Expand Down
52 changes: 0 additions & 52 deletions requirements/ci/py36.yml

This file was deleted.

1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,4 +279,5 @@ def long_description():
"docs": pip_requirements("docs"),
"test": pip_requirements("test"),
},
python_requires=">=3.7",
)