Skip to content

Commit 894050e

Browse files
committed
Add docs/internal/ci-dependencies.rst
1 parent 3fc05d5 commit 894050e

File tree

2 files changed

+60
-0
lines changed

2 files changed

+60
-0
lines changed

docs/internal/ci-dependencies.rst

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
==============================================
2+
Dependency versions for continuous integration
3+
==============================================
4+
5+
In order to make CI reproducible we pin the installed Python dependencies.
6+
These dependencies should be updated every few months in order to stay relevant.
7+
8+
CI tests are also run against the latest of all dependencies in a separate job.
9+
This job is allowed to fail without breaking the build.
10+
It acts as a canary so we can see new breakages as they happen
11+
without needing to fix issues from new package versions in unrelated pull requests.
12+
13+
Supported Python versions and dependency versions follows `SPEC-0000 <https://scientific-python.org/specs/spec-0000/>`_.
14+
15+
Updating supported Python versions
16+
==================================
17+
18+
To add a new supported version of Python the following changes must be made:
19+
20+
* Update the pinned dependencies:
21+
add a new version to the list in ``scripts/update_pinned_dependencies.sh``, and
22+
rebuild the pinned dependencies by running the script.
23+
* Update ``.github/workflows/ci.yaml``:
24+
set ``env.python-version`` to the new version,
25+
add the new version to the ``test`` job ``python-version`` matrix variable, and
26+
update the version associated with the ``dependencies: "latest"`` matrix job.
27+
* Update ``tox.ini``:
28+
add the new version to the ``envlist`` for pinned dependencies, and
29+
update the version used in the latest dependencies.
30+
* Add a release note.
31+
32+
To remove support for an old version of Python the following changes must be made:
33+
34+
* Update the pinned dependencies:
35+
remove the old version from the list in ``scripts/update_pinned_dependencies.sh``,
36+
remove the old ``continuous-integration/requirements-X.YY.txt`` file, and
37+
rebuild the pinned dependencies by running the script.
38+
* Update ``.github/workflows/ci.yaml``:
39+
remove the version from the ``test`` job ``python-version`` matrix variable, and
40+
update the version associated with the ``dependencies: "minimum"`` matrix job.
41+
* Update ``tox.ini``:
42+
remove the old version from the ``envlist`` for pinned dependencies, and
43+
update the version used in the minimum dependencies.
44+
* Update ``pyproject.toml``:
45+
update the ``[project] requires-python`` field, and
46+
update the ``[tool.mypy] python_version`` field.
47+
* Add a release note.
48+
49+
Updating pinned dependencies
50+
============================
51+
52+
To update the list of pinned dependencies used for CI
53+
run the ``scripts/update_pinned_dependencies.sh`` script.
54+
This will create an isolated conda prefix for each of the supported Python versions,
55+
install `pip-tools <https://github.com/jazzband/pip-tools/>`_,
56+
and create a fresh requirements document.
57+
Commit the changes to the pinned requirements,
58+
run the test suite against all supported Python versions, and
59+
fix any new issues that appear.

docs/internal/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ Internal documentation
88
:maxdepth: 1
99

1010
releasing
11+
ci-dependencies

0 commit comments

Comments
 (0)