Skip to content

Commit eb7dfc3

Browse files
bjlittlepp-mostephenworsleytkknightjamesp
authored
Mesh data model to ng vat mesh api (SciTools#4023)
* Update mesh-data-model branch (SciTools#4009) * Add abstract cube summary (SciTools#3987) Co-authored-by: stephen.worsley <[email protected]> * add nox session conda list (SciTools#3990) * Added text to state the Python version used to build the docs. (SciTools#3989) * Added text to state the Python version used to build the docs. * Added footer template that includes the Python version used to build. * added new line * Review actions * added whatsnew * Iris py38 (SciTools#3976) * support for py38 * update CI and noxfile * enforce alphabetical xml element attribute order * full tests for py38 + fix docs-tests * add whatsnew entry * update doc-strings + review actions * Alternate xml handling routine (#29) * all xml tests pass for nox tests-3.8 * restored docstrings * move sort_xml_attrs * make sort_xml_attrs a classmethod * update sort_xml_attr doc-string Co-authored-by: Bill Little <[email protected]> * add jamesp to whatsnew + minor tweak Co-authored-by: James Penn <[email protected]> * normalise version to implicit development release number (SciTools#3991) * Gallery: update COP maps example (SciTools#3934) * update cop maps example * comment tweaks * minor comment tweak + whatsnew * reinstate whatsnew addition * remove duplicate whatsnew * don't support mpl v1.2 (SciTools#3941) * Cubesummary tidy (SciTools#3988) * Extra tests; fix for array attributes. * Docstring for CubeSummary, and remove some unused parts. * Fix section name capitalisation, in line with existing cube summary. * Handle array differences; quote strings in extras and if 'awkward'-printing. * Ensure scalar string coord 'content' prints on one line. * update intersphinx mapping and matplotlib urls (SciTools#4003) * update intersphinx mapping and matplotlib urls * use matplotlib intersphinx where possible * review actions * review actions * update readme badges (SciTools#4004) * update readme badges * pimp twitter badge * update readme logo img src and href (SciTools#4006) * update setuptools description (SciTools#4008) Co-authored-by: Patrick Peglar <[email protected]> Co-authored-by: stephen.worsley <[email protected]> Co-authored-by: tkknight <[email protected]> Co-authored-by: James Penn <[email protected]> Co-authored-by: Ruth Comer <[email protected]> * Master to mesh data model (SciTools#4022) * Add abstract cube summary (SciTools#3987) Co-authored-by: stephen.worsley <[email protected]> * add nox session conda list (SciTools#3990) * Added text to state the Python version used to build the docs. (SciTools#3989) * Added text to state the Python version used to build the docs. * Added footer template that includes the Python version used to build. * added new line * Review actions * added whatsnew * Iris py38 (SciTools#3976) * support for py38 * update CI and noxfile * enforce alphabetical xml element attribute order * full tests for py38 + fix docs-tests * add whatsnew entry * update doc-strings + review actions * Alternate xml handling routine (#29) * all xml tests pass for nox tests-3.8 * restored docstrings * move sort_xml_attrs * make sort_xml_attrs a classmethod * update sort_xml_attr doc-string Co-authored-by: Bill Little <[email protected]> * add jamesp to whatsnew + minor tweak Co-authored-by: James Penn <[email protected]> * normalise version to implicit development release number (SciTools#3991) * Gallery: update COP maps example (SciTools#3934) * update cop maps example * comment tweaks * minor comment tweak + whatsnew * reinstate whatsnew addition * remove duplicate whatsnew * don't support mpl v1.2 (SciTools#3941) * Cubesummary tidy (SciTools#3988) * Extra tests; fix for array attributes. * Docstring for CubeSummary, and remove some unused parts. * Fix section name capitalisation, in line with existing cube summary. * Handle array differences; quote strings in extras and if 'awkward'-printing. * Ensure scalar string coord 'content' prints on one line. * update intersphinx mapping and matplotlib urls (SciTools#4003) * update intersphinx mapping and matplotlib urls * use matplotlib intersphinx where possible * review actions * review actions * update readme badges (SciTools#4004) * update readme badges * pimp twitter badge * update readme logo img src and href (SciTools#4006) * update setuptools description (SciTools#4008) * cirrus-ci compute credits (SciTools#4007) * update release process (SciTools#4010) * Stop using deprecated aliases of builtin types (SciTools#3997) * Stopped using deprecated aliases of builtin types. This is required to avoid warnings starting with NumPy 1.20.0. * Update lib/iris/tests/test_cell.py Co-authored-by: Bill Little <[email protected]> * Update lib/iris/tests/test_cell.py Co-authored-by: Bill Little <[email protected]> * Updated whatsnew. Co-authored-by: Bill Little <[email protected]> * celebrate first time iris contributors (SciTools#4013) * Docs unreleased banner (SciTools#3999) * baseline * removed debug comments * reverted * remove line * Testing * testing extensions * testing rtd_version * fixed if * removed line * tidy up * tidy comments * debug of pre-existing rtd variables * added reminder * testing * testing still * updated comments * added whatsnew * expanded the if conditiion * review actions * Update layout.html Remove alternative banner that used the RestructuredText notation. * review actions * drop __unicode__ method usage (SciTools#4018) * cirrus-ci conditional tasks (SciTools#4019) * cirrus-ci conditional tasks * use bc for bash arithmetic * revert back to sed * use expr * reword * minor documentation changes * review actions * make iris.common.metadata._hexdigest public (SciTools#4020) Co-authored-by: Patrick Peglar <[email protected]> Co-authored-by: stephen.worsley <[email protected]> Co-authored-by: tkknight <[email protected]> Co-authored-by: James Penn <[email protected]> Co-authored-by: Ruth Comer <[email protected]> Co-authored-by: Alexander Kuhn-Regnier <[email protected]> Co-authored-by: Patrick Peglar <[email protected]> Co-authored-by: stephen.worsley <[email protected]> Co-authored-by: tkknight <[email protected]> Co-authored-by: James Penn <[email protected]> Co-authored-by: Ruth Comer <[email protected]> Co-authored-by: Alexander Kuhn-Regnier <[email protected]>
1 parent 682136b commit eb7dfc3

38 files changed

Lines changed: 383 additions & 218 deletions

.cirrus.yml

Lines changed: 55 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Reference:
22
# - https://cirrus-ci.org/guide/writing-tasks/
3+
# - https://cirrus-ci.org/guide/writing-tasks/#environment-variables
34
# - https://cirrus-ci.org/guide/tips-and-tricks/#sharing-configuration-between-tasks
45
# - https://cirrus-ci.org/guide/linux/
56
# - https://cirrus-ci.org/guide/macOS/
@@ -17,6 +18,16 @@ container:
1718

1819

1920
env:
21+
# Skip specific tasks by name. Set to a non-empty string to skip.
22+
SKIP_LINT_TASK: ""
23+
SKIP_TEST_MINIMAL_TASK: ""
24+
SKIP_TEST_FULL_TASK: ""
25+
SKIP_GALLERY_TASK: ""
26+
SKIP_DOCTEST_TASK: ""
27+
SKIP_LINKCHECK_TASK: ""
28+
# Skip task groups by type. Set to a non-empty string to skip.
29+
SKIP_ALL_TEST_TASKS: ""
30+
SKIP_ALL_DOC_TASKS: ""
2031
# Maximum cache period (in weeks) before forcing a new cache upload.
2132
CACHE_PERIOD: "2"
2233
# Increment the build number to force new cartopy cache upload.
@@ -35,25 +46,6 @@ env:
3546
IRIS_TEST_DATA_DIR: ${HOME}/iris-test-data
3647

3748

38-
#
39-
# Linting
40-
#
41-
lint_task:
42-
auto_cancellation: true
43-
name: "${CIRRUS_OS}: flake8 and black"
44-
pip_cache:
45-
folder: ~/.cache/pip
46-
fingerprint_script:
47-
- echo "${CIRRUS_TASK_NAME}"
48-
- echo "$(date +%Y).$(($(date +%U) / ${CACHE_PERIOD})):${PIP_CACHE_BUILD} ${PIP_CACHE_PACKAGES}"
49-
lint_script:
50-
- pip list
51-
- python -m pip install --retries 3 --upgrade ${PIP_CACHE_PACKAGES}
52-
- pip list
53-
- nox --session flake8
54-
- nox --session black
55-
56-
5749
#
5850
# YAML alias for common linux test infra-structure.
5951
#
@@ -68,7 +60,7 @@ linux_task_template: &LINUX_TASK_TEMPLATE
6860
fingerprint_script:
6961
- wget --quiet https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
7062
- echo "${CIRRUS_OS} $(sha256sum miniconda.sh)"
71-
- echo "$(date +%Y).$(($(date +%U) / ${CACHE_PERIOD})):${CONDA_CACHE_BUILD}"
63+
- echo "$(date +%Y).$(expr $(date +%U) / ${CACHE_PERIOD}):${CONDA_CACHE_BUILD}"
7264
populate_script:
7365
- bash miniconda.sh -b -p ${HOME}/miniconda
7466
- conda config --set always_yes yes --set changeps1 no
@@ -80,19 +72,49 @@ linux_task_template: &LINUX_TASK_TEMPLATE
8072
folder: ${HOME}/.local/share/cartopy
8173
fingerprint_script:
8274
- echo "${CIRRUS_OS}"
83-
- echo "$(date +%Y).$(($(date +%U) / ${CACHE_PERIOD})):${CARTOPY_CACHE_BUILD}"
75+
- echo "$(date +%Y).$(expr $(date +%U) / ${CACHE_PERIOD}):${CARTOPY_CACHE_BUILD}"
8476
nox_cache:
8577
folder: ${CIRRUS_WORKING_DIR}/.nox
8678
fingerprint_script:
8779
- echo "${CIRRUS_TASK_NAME}"
88-
- echo "$(date +%Y).$(($(date +%U) / ${CACHE_PERIOD})):${NOX_CACHE_BUILD}"
80+
- echo "$(date +%Y).$(expr $(date +%U) / ${CACHE_PERIOD}):${NOX_CACHE_BUILD}"
8981
- sha256sum ${CIRRUS_WORKING_DIR}/requirements/ci/py$(echo ${PY_VER} | tr -d ".").yml
9082

9183

84+
#
85+
# YAML alias for compute credits
86+
#
87+
compute_credits_template: &CREDITS_TEMPLATE
88+
# Only use credits for non-DRAFT pull-requests to SciTools/iris master branch by collaborators
89+
use_compute_credits: $CIRRUS_REPO_FULL_NAME == 'SciTools/iris' && $CIRRUS_USER_COLLABORATOR == 'true' && $CIRRUS_PR_DRAFT == 'false' && $CIRRUS_BASE_BRANCH == 'master' && $CIRRUS_PR != ''
90+
91+
#
92+
# Linting
93+
#
94+
lint_task:
95+
only_if: $SKIP_LINT_TASK == ""
96+
<< : *CREDITS_TEMPLATE
97+
auto_cancellation: true
98+
name: "${CIRRUS_OS}: flake8 and black"
99+
pip_cache:
100+
folder: ~/.cache/pip
101+
fingerprint_script:
102+
- echo "${CIRRUS_TASK_NAME}"
103+
- echo "$(date +%Y).$(expr $(date +%U) / ${CACHE_PERIOD}):${PIP_CACHE_BUILD} ${PIP_CACHE_PACKAGES}"
104+
lint_script:
105+
- pip list
106+
- python -m pip install --retries 3 --upgrade ${PIP_CACHE_PACKAGES}
107+
- pip list
108+
- nox --session flake8
109+
- nox --session black
110+
111+
92112
#
93113
# Testing Minimal (Linux)
94114
#
95-
linux_minimal_task:
115+
test_minimal_task:
116+
only_if: $SKIP_TEST_MINIMAL_TASK == "" && $SKIP_ALL_TEST_TASKS == ""
117+
<< : *CREDITS_TEMPLATE
96118
matrix:
97119
env:
98120
PY_VER: 3.6
@@ -115,7 +137,9 @@ linux_minimal_task:
115137
#
116138
# Testing Full (Linux)
117139
#
118-
linux_task:
140+
test_full_task:
141+
only_if: $SKIP_TEST_FULL_TASK == "" && $SKIP_ALL_TEST_TASKS == ""
142+
<< : *CREDITS_TEMPLATE
119143
matrix:
120144
env:
121145
PY_VER: 3.6
@@ -148,6 +172,8 @@ linux_task:
148172
# Testing Documentation Gallery (Linux)
149173
#
150174
gallery_task:
175+
only_if: $SKIP_GALLERY_TASK == "" && $SKIP_ALL_DOC_TASKS == ""
176+
<< : *CREDITS_TEMPLATE
151177
matrix:
152178
env:
153179
PY_VER: 3.8
@@ -176,6 +202,8 @@ gallery_task:
176202
# Testing Documentation (Linux)
177203
#
178204
doctest_task:
205+
only_if: $SKIP_DOCTEST_TASK == "" && $SKIP_ALL_DOC_TASKS == ""
206+
<< : *CREDITS_TEMPLATE
179207
matrix:
180208
env:
181209
PY_VER: 3.8
@@ -209,7 +237,9 @@ doctest_task:
209237
#
210238
# Testing Documentation Link Check (Linux)
211239
#
212-
link_task:
240+
linkcheck_task:
241+
only_if: $SKIP_LINKCHECK_TASK == "" && $SKIP_ALL_DOC_TASKS == ""
242+
<< : *CREDITS_TEMPLATE
213243
matrix:
214244
env:
215245
PY_VER: 3.8

docs/src/_static/theme_override.css

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,17 @@ table.docutils td {
2626
word-wrap: break-word;
2727
}
2828

29+
/* Used for very strong warning */
30+
#slim-red-box-message {
31+
background: #ff0000;
32+
box-sizing: border-box;
33+
color: #ffffff;
34+
font-weight: normal;
35+
padding: 0.5em;
36+
}
37+
38+
#slim-red-box-message a {
39+
color: #ffffff;
40+
font-weight: normal;
41+
text-decoration:underline;
42+
}

docs/src/_templates/layout.html

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,27 @@
11
{% extends "!layout.html" %}
22

3+
{# This uses blocks. See:
4+
https://www.sphinx-doc.org/en/master/templating.html
5+
#}
6+
7+
/*---------------------------------------------------------------------------*/
8+
9+
{%- block document %}
10+
{% if READTHEDOCS and rtd_version == 'latest' %}
11+
<div id="slim-red-box-message">
12+
You are viewing the <b>latest</b> unreleased documentation
13+
<b>v{{ version }}</b>. You may prefer a
14+
<a href="https://scitools-iris.readthedocs.io/en/stable/">stable</a>
15+
version.
16+
</div>
17+
<p></p>
18+
{%- endif %}
19+
20+
{{ super() }}
21+
{%- endblock %}
22+
23+
/*-----------------------------------------------------z----------------------*/
24+
325
{% block menu %}
426
{{ super() }}
527

docs/src/common_links.inc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
.. _black: https://black.readthedocs.io/en/stable/
55
.. _.cirrus.yml: https://github.com/SciTools/iris/blob/master/.cirrus.yml
6+
.. _flake8: https://flake8.pycqa.org/en/stable/
67
.. _.flake8.yml: https://github.com/SciTools/iris/blob/master/.flake8
78
.. _cirrus-ci: https://cirrus-ci.com/github/SciTools/iris
89
.. _conda: https://docs.conda.io/en/latest/
@@ -24,6 +25,7 @@
2425
.. _New Issue: https://github.com/scitools/iris/issues/new/choose
2526
.. _pull request: https://github.com/SciTools/iris/pulls
2627
.. _pull requests: https://github.com/SciTools/iris/pulls
28+
.. _Read the Docs: https://scitools-iris.readthedocs.io/en/latest/
2729
.. _readthedocs.yml: https://github.com/SciTools/iris/blob/master/requirements/ci/readthedocs.yml
2830
.. _SciTools: https://github.com/SciTools
2931
.. _sphinx: https://www.sphinx-doc.org/en/master/

docs/src/conf.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ def autolog(message):
4343
for item, value in os.environ.items():
4444
autolog("[READTHEDOCS] {} = {}".format(item, value))
4545

46+
# This is the rtd reference to the version, such as: latest, stable, v3.0.1 etc
47+
# For local testing purposes this could be explicitly set latest or stable.
48+
rtd_version = os.environ.get("READTHEDOCS_VERSION")
4649

4750
# -- Path setup --------------------------------------------------------------
4851

@@ -131,7 +134,6 @@ def autolog(message):
131134
"custom_data_autodoc",
132135
"generate_package_rst",
133136
]
134-
135137
# -- panels extension ---------------------------------------------------------
136138
# See https://sphinx-panels.readthedocs.io/en/latest/
137139

@@ -165,7 +167,7 @@ def autolog(message):
165167
# See https://sphinx-copybutton.readthedocs.io/en/latest/
166168
copybutton_prompt_text = ">>> "
167169

168-
# sphinx.ext.todo configuration
170+
# sphinx.ext.todo configuration -----------------------------------------------
169171
# See https://www.sphinx-doc.org/en/master/usage/extensions/todo.html
170172
todo_include_todos = True
171173

@@ -228,6 +230,8 @@ def autolog(message):
228230
}
229231

230232
html_context = {
233+
"rtd_version": rtd_version,
234+
"version": version,
231235
"copyright_years": copyright_years,
232236
"python_version": build_python_version,
233237
# menu_links and menu_links_name are used in _templates/layout.html
@@ -296,7 +300,6 @@ def autolog(message):
296300
"ignore_pattern": r"__init__\.py",
297301
}
298302

299-
300303
# -----------------------------------------------------------------------------
301304
# Remove matplotlib agg warnings from generated doc when using plt.show
302305
warnings.filterwarnings(
@@ -306,7 +309,6 @@ def autolog(message):
306309
" non-GUI backend, so cannot show the figure.",
307310
)
308311

309-
310312
# -- numfig options (built-in) ------------------------------------------------
311313
# Enable numfig.
312314
numfig = True

docs/src/developers_guide/contributing_ci_tests.rst

Lines changed: 57 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
Continuous Integration (CI) Testing
66
===================================
77

8-
The `Iris`_ GitHub repository is configured to run checks on the code
9-
automatically when a pull request is created, updated or merged against
10-
Iris **master**. The checks performed are:
8+
The `Iris`_ GitHub repository is configured to run checks against all its
9+
branches automatically whenever a pull request is created, updated or merged.
10+
The checks performed are:
1111

1212
* :ref:`testing_cla`
1313
* :ref:`testing_cirrus`
@@ -18,29 +18,65 @@ Iris **master**. The checks performed are:
1818
SciTools CLA Checker
1919
********************
2020

21-
A bot that checks the user who created the pull request has signed the
22-
**Contributor's License Agreement (CLA)**. For more information on this this
23-
please see https://scitools.org.uk/organisation.html#governance
21+
A bot which checks that the GitHub author of the pull request has signed the
22+
**SciTools Contributor's License Agreement (CLA)**. For more information on
23+
this please see https://scitools.org.uk/organisation.html#governance.
2424

2525

2626
.. _testing_cirrus:
2727

2828
Cirrus-CI
2929
*********
3030

31-
The unit and integration tests in Iris are an essential mechanism to ensure
31+
Iris unit and integration tests are an essential mechanism to ensure
3232
that the Iris code base is working as expected. :ref:`developer_running_tests`
33-
may be run manually but to ensure the checks are performed a
34-
continuous integration testing tool named `cirrus-ci`_ is used.
33+
may be performed manually by a developer locally. However Iris is configured to
34+
use the `cirrus-ci`_ service for automated Continuous Integration (CI) testing.
3535

36-
A `cirrus-ci`_ configuration file named `.cirrus.yml`_
37-
is in the Iris repository which tells Cirrus-CI what commands to run. The
38-
commands include retrieving the Iris code base and associated test files using
39-
conda and then running the tests. `cirrus-ci`_ allows for a matrix of tests to
40-
be performed to ensure that all expected variations test successfully.
36+
The `cirrus-ci`_ configuration file `.cirrus.yml`_ in the root of the Iris repository
37+
defines the tasks to be performed by `cirrus-ci`_. For further details
38+
refer to the `Cirrus-CI Documentation`_. The tasks performed during CI include:
39+
40+
* linting the code base and ensuring it adheres to the `black`_ format
41+
* running the system, integration and unit tests for Iris
42+
* ensuring the documentation gallery builds successfully
43+
* performing all doc-tests within the code base
44+
* checking all URL references within the code base and documentation are valid
45+
46+
The above `cirrus-ci`_ tasks are run automatically against all `Iris`_ branches
47+
on GitHub whenever a pull request is submitted, updated or merged. See the
48+
`Cirrus-CI Dashboard`_ for details of recent past and active Iris jobs.
49+
50+
.. _skipping Cirrus-CI tasks:
51+
52+
Skipping Cirrus-CI Tasks
53+
------------------------
54+
55+
As a developer you may wish to not run all the CI tasks when you are actively
56+
developing e.g., you are writing documentation and there is no need for linting,
57+
or long running compute intensive testing tasks to be executed.
58+
59+
As a convenience, it is possible to easily skip one or more tasks by setting
60+
the appropriate environment variable within the `.cirrus.yml`_ file to a
61+
**non-empty** string:
62+
63+
* ``SKIP_LINT_TASK`` to skip `flake8`_ linting and `black`_ formatting
64+
* ``SKIP_TEST_MINIMAL_TASK`` to skip restricted unit and integration testing
65+
* ``SKIP_TEST_FULL_TASK`` to skip full unit and integration testing
66+
* ``SKIP_GALLERY_TASK`` to skip building the documentation gallery
67+
* ``SKIP_DOCTEST_TASK`` to skip running the documentation doc-tests
68+
* ``SKIP_LINKCHECK_TASK`` to skip checking for broken documentation URL references
69+
* ``SKIP_ALL_TEST_TASKS`` which is equivalent to setting ``SKIP_TEST_MINIMAL_TASK`` and ``SKIP_TEST_FULL_TASK``
70+
* ``SKIP_ALL_DOC_TASKS`` which is equivalent to setting ``SKIP_GALLERY_TASK``, ``SKIP_DOCTEST_TASK``, and ``SKIP_LINKCHECK_TASK``
71+
72+
e.g., to skip the linting task, the following are all equivalent::
73+
74+
SKIP_LINT_TASK: "1"
75+
SKIP_LINT_TASK: "true"
76+
SKIP_LINT_TASK: "false"
77+
SKIP_LINT_TASK: "skip"
78+
SKIP_LINT_TASK: "unicorn"
4179

42-
The `cirrus-ci`_ tests are run automatically against the `Iris`_ master
43-
repository when a pull request is submitted, updated or merged.
4480

4581
GitHub Checklist
4682
****************
@@ -50,6 +86,10 @@ passing:
5086

5187
.. image:: ci_checks.png
5288

53-
If any CI checks fail, then the pull request is unlikely to be merged to the
89+
If any CI tasks fail, then the pull request is unlikely to be merged to the
5490
Iris target branch by a core developer.
5591

92+
93+
.. _Cirrus-CI Dashboard: https://cirrus-ci.com/github/SciTools/iris
94+
.. _Cirrus-CI Documentation: https://cirrus-ci.org/guide/writing-tasks/
95+

docs/src/developers_guide/contributing_code_formatting.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,4 @@ will look similar to::
5858
their officially documentation for more information.
5959

6060

61-
.. _black: https://black.readthedocs.io/en/stable/
62-
.. _flake8: https://flake8.pycqa.org/en/stable/
6361
.. _pre-commit: https://pre-commit.com/

0 commit comments

Comments
 (0)