Skip to content

Commit

Permalink
standardize requirements structure (#5204)
Browse files Browse the repository at this point in the history
  • Loading branch information
bjlittle authored Mar 23, 2023
1 parent b228f20 commit 73b4a3a
Show file tree
Hide file tree
Showing 17 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ build:
- git stash pop

conda:
environment: requirements/ci/readthedocs.yml
environment: requirements/readthedocs.yml

sphinx:
configuration: docs/src/conf.py
Expand Down
4 changes: 2 additions & 2 deletions docs/src/common_links.inc
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@
.. _pull request: https://github.com/SciTools/iris/pulls
.. _pull requests: https://github.com/SciTools/iris/pulls
.. _Read the Docs: https://scitools-iris.readthedocs.io/en/latest/
.. _readthedocs.yml: https://github.com/SciTools/iris/blob/main/requirements/ci/readthedocs.yml
.. _readthedocs.yml: https://github.com/SciTools/iris/blob/main/requirements/readthedocs.yml
.. _SciTools: https://github.com/SciTools
.. _scitools-iris: https://pypi.org/project/scitools-iris/
.. _sphinx: https://www.sphinx-doc.org/en/master/
.. _test-iris-imagehash: https://github.com/SciTools/test-iris-imagehash
.. _using git: https://docs.github.com/en/github/using-git
.. _requirements/ci/: https://github.com/SciTools/iris/tree/main/requirements/ci
.. _requirements: https://github.com/SciTools/iris/tree/main/requirements
.. _CF-UGRID: https://ugrid-conventions.github.io/ugrid-conventions/
.. _issues on GitHub: https://github.com/SciTools/iris/issues?q=is%3Aopen+is%3Aissue+sort%3Areactions-%2B1-desc
.. _python-stratify: https://github.com/SciTools/python-stratify
Expand Down
2 changes: 1 addition & 1 deletion docs/src/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def _dotv(version):

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

if not python_support:
Expand Down
8 changes: 4 additions & 4 deletions docs/src/developers_guide/contributing_ci_tests.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,18 @@ GitHub Actions Test Environment
-------------------------------

The CI test environments for our GHA is determined from the requirement files
in ``requirements/ci/pyXX.yml``. These are conda environment files list the top-level
in ``requirements/pyXX.yml``. These are conda environment files list the top-level
package dependencies for running and testing Iris.

For reproducible test results, these environments are resolved for all their dependencies
and stored as conda lock files in the ``requirements/ci/nox.lock`` directory. The test environments
and stored as conda lock files in the ``requirements/locks`` directory. The test environments
will not resolve the dependencies each time, instead they will use the lock files to reproduce the
exact same environment each time.

**If you have updated the requirement YAML files with new dependencies, you will need to
generate new lock files.** To do this, run the command::

python tools/update_lockfiles.py -o requirements/ci/nox.lock requirements/ci/py*.yml
python tools/update_lockfiles.py -o requirements/locks requirements/py*.yml

or simply::

Expand All @@ -76,7 +76,7 @@ and add the changed lockfiles to your pull request.

New lockfiles are generated automatically each week to ensure that Iris continues to be
tested against the latest available version of its dependencies.
Each week the yaml files in ``requirements/ci`` are resolved by a GitHub Action.
Each week the yaml files in ``requirements`` are resolved by a GitHub Action.
If the resolved environment has changed, a pull request is created with the new lock files.
The CI test suite will run on this pull request. If the tests fail, a developer
will need to create a new branch based off the ``auto-update-lockfiles`` branch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ is merged. Before submitting a pull request please consider this list.
#. **Check all modified and new source files conform to the required**
:ref:`code_formatting`.

#. **Check all new dependencies added to the** `requirements/ci/`_ **yaml
#. **Check all new dependencies added to the** `requirements`_ **yaml
files.** If dependencies have been added then new nox testing lockfiles
should be generated too, see :ref:`gha_test_env`.

Expand Down
10 changes: 5 additions & 5 deletions docs/src/installing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Once conda is installed, you can install Iris using conda and then activate
it. The example commands below assume you are in the root directory of your
local copy of Iris::

conda env create --force --file=requirements/ci/iris.yml
conda env create --force --file=requirements/iris.yml
conda activate iris-dev

.. note::
Expand All @@ -92,20 +92,20 @@ local copy of Iris::
particularly useful when rebuilding your environment due to a change in
requirements.

The ``requirements/ci/iris.yml`` file defines the Iris development conda
The ``requirements/iris.yml`` file defines the Iris development conda
environment *name* and all the relevant *top level* `conda-forge` package
dependencies that you need to **code**, **test**, and **build** the
documentation. If you wish to minimise the environment footprint, simply
remove any unwanted packages from the requirements file e.g., if you don't
intend to run the Iris tests locally or build the documentation, then remove
all the packages from the `testing` and `documentation` sections.

.. note:: The ``requirements/ci/iris.yml`` file will always use the latest
.. note:: The ``requirements/iris.yml`` file will always use the latest
Iris tested Python version available. For all Python versions that
are supported and tested against by Iris, view the contents of
the `requirements/ci`_ directory.
the `requirements`_ directory.

.. _requirements/ci: https://github.com/scitools/iris/tree/main/requirements/ci
.. _requirements: https://github.com/scitools/iris/tree/main/requirements

Finally you need to run the command to configure your shell environment
to find your local Iris code::
Expand Down
2 changes: 1 addition & 1 deletion docs/src/whatsnew/2.1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,5 @@ Internal
__ `netCDF4`_

* Iris now requires version 2 of Matplotlib, and ``>=1.14`` of NumPy.
Full requirements can be seen in the `requirements <https://github.com/SciTools/iris/>`_
Full requirements can be seen in the `requirements`_
directory of the Iris' the source.
2 changes: 1 addition & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
def session_lockfile(session: nox.sessions.Session) -> Path:
"""Return the path of the session lockfile."""
return Path(
f"requirements/ci/nox.lock/py{session.python.replace('.', '')}-linux-64.lock"
f"requirements/locks/py{session.python.replace('.', '')}-linux-64.lock"
)


Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion tools/update_lockfiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
that nox uses for testing each different supported version of python.
Typical usage:
python tools/update_lockfiles.py -o requirements/ci/nox.lock requirements/ci/py*.yml
python tools/update_lockfiles.py -o requirements/locks requirements/py*.yml
"""
Expand Down

0 comments on commit 73b4a3a

Please sign in to comment.