Skip to content

Commit e2f9b17

Browse files
authored
New Doc: docs/devguide/release.rst (#262)
1 parent 140eacd commit e2f9b17

File tree

4 files changed

+120
-1
lines changed

4 files changed

+120
-1
lines changed

docs/devguide/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ are used and how to set up a local development environment.
2020
local-development-environment
2121
tox
2222
sphinx
23+
release

docs/devguide/release.rst

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
.. _release:
2+
3+
==============================
4+
How to release a new version
5+
==============================
6+
7+
:Release: |version|
8+
:Date: |today|
9+
10+
The following guide will describe the steps to release a new version of the :pypi:`pytest-celery <pytest-celery>` plugin.
11+
It will explain how does the CI/CD pipeline work and how to trigger a new release.
12+
13+
.. contents::
14+
:local:
15+
:depth: 3
16+
17+
CI/CD Pipeline
18+
==============
19+
20+
Continuous Integration
21+
~~~~~~~~~~~~~~~~~~~~~~
22+
23+
.. versionadded:: 1.0.0
24+
25+
The `CI <https://github.com/celery/pytest-celery/actions>`_ platform is based on GitHub Actions and it is triggered on every push to the repository,
26+
and on every pull request, according to the changes made.
27+
28+
The configuration files for the CI pipeline are located in the `.github/workflows <https://github.com/celery/pytest-celery/tree/main/.github/workflows>`_
29+
directory of the repository.
30+
31+
CI Tests
32+
--------
33+
34+
Unit, Integration and Smoke tests.
35+
36+
.. literalinclude:: ../../.github/workflows/python-package.yml
37+
:language: yaml
38+
:caption: .github/workflows/python-package.yml
39+
40+
Parallel Tests
41+
--------------
42+
43+
These are the :ref:`tox_parallel` and :ref:`tox_xdist` tox environments. The purpose
44+
of this CI pipeline is to make sure that the plugin is compatible with parallel running, both
45+
in terms of supporting :pypi:`pytest-xdist <pytest-xdist>` and functionally (i.e. that the plugin
46+
does not break when running in parallel).
47+
48+
.. literalinclude:: ../../.github/workflows/parallel-support.yml
49+
:language: yaml
50+
:caption: .github/workflows/python-package.yml
51+
52+
Linting
53+
-------
54+
55+
Standard linting checks.
56+
57+
.. literalinclude:: ../../.github/workflows/linter.yml
58+
:language: yaml
59+
:caption: .github/workflows/linting.yml
60+
61+
Examples
62+
--------
63+
64+
The official plugin examples are tested as part of the standard CI pipeline.
65+
66+
.. literalinclude:: ../../.github/workflows/examples.yml
67+
:language: yaml
68+
:caption: .github/workflows/examples.yml
69+
70+
Docker
71+
------
72+
73+
This pipeline is used to to make sure the provided Dockerfiles from the plugin are built successfully.
74+
75+
.. literalinclude:: ../../.github/workflows/docker.yml
76+
:language: yaml
77+
:caption: .github/workflows/docker.yml
78+
79+
.. _continuous_deployment:
80+
81+
Continuous Deployment
82+
~~~~~~~~~~~~~~~~~~~~~
83+
84+
.. versionadded:: 1.0.0
85+
86+
The `CD <https://github.com/celery/pytest-celery/actions/workflows/deploy.yml>`_ is configured to deploy a new
87+
release to the `PyPI <https://pypi.org/project/pytest-celery/#history>`_ package index.
88+
89+
The following release workflow is triggered automatically when a new released is tagged and published on GitHub.
90+
91+
.. literalinclude:: ../../.github/workflows/deploy.yml
92+
:language: yaml
93+
:caption: .github/workflows/deploy.yml
94+
95+
.. note::
96+
97+
The ``poetry version`` command should say there's nothing to change, because this should have been done in the PR that prepared the release.
98+
99+
Release Steps
100+
=============
101+
102+
To make a new release, you need to create a new PR with one of these titles.
103+
104+
- **Official Release**: Prepare for release: vX.Y.Z
105+
- **Pre-release**: Prepare for (pre) release: vX.Y.Z
106+
107+
The PR should contain the following changes:
108+
109+
- Version bump using `poetry version <https://python-poetry.org/docs/cli#version>`_ command.
110+
- Changelog update.
111+
112+
This PR will be used as a double check for the CI to make sure everything passes successfully before releasing the new version.
113+
Once this PR is merged, the last step is to `release a version on GitHub <https://github.com/celery/pytest-celery/releases/new>`_.
114+
This will trigger the :ref:`CD pipeline <continuous_deployment>` to deploy the new release to PyPI automatically.

docs/devguide/tox.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ To run this environment, use::
103103

104104
tox -e xdist
105105

106+
.. _tox_parallel:
107+
106108
parallel
107109
========
108110

@@ -171,6 +173,8 @@ To run **just the pre-commit** locally (without tox, without doc), use::
171173

172174
pre-commit run --show-diff-on-failure --color=always --all-files
173175

176+
.. _tox_clean:
177+
174178
clean
175179
=====
176180

docs/faq.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ The Docker environment should be install normally, regardless of the plugin.
149149
How can I clean up Docker artifacts left after a test run?
150150
----------------------------------------------------------
151151

152-
**Answer:** You may use this snippet from the ``tox -e clean`` environment.
152+
**Answer:** You may use this snippet from the :ref:`tox_clean` tox environment.
153153

154154
.. literalinclude:: ../tox.ini
155155
:language: ini

0 commit comments

Comments
 (0)