2017-09-08 04:48:34 +08:00
|
|
|
Release Procedure
|
|
|
|
-----------------
|
|
|
|
|
2020-01-24 03:34:21 +08:00
|
|
|
Our current policy for releasing is to aim for a bug-fix release every few weeks and a minor release every 2-3 months. The idea
|
2017-09-08 04:48:34 +08:00
|
|
|
is to get fixes and new features out instead of trying to cram a ton of features into a release and by consequence
|
|
|
|
taking a lot of time to make a new one.
|
2014-09-05 19:13:23 +08:00
|
|
|
|
2020-08-02 00:46:35 +08:00
|
|
|
The git commands assume the following remotes are setup:
|
|
|
|
|
|
|
|
* ``origin``: your own fork of the repository.
|
|
|
|
* ``upstream``: the ``pytest-dev/pytest`` official repository.
|
|
|
|
|
2020-03-02 01:46:35 +08:00
|
|
|
Preparing: Automatic Method
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
We have developed an automated workflow for releases, that uses GitHub workflows and is triggered
|
2020-08-02 00:46:35 +08:00
|
|
|
by opening an issue.
|
|
|
|
|
|
|
|
Bug-fix releases
|
|
|
|
^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
A bug-fix release is always done from a maintenance branch, so for example to release bug-fix
|
|
|
|
``5.1.2``, open a new issue and add this comment to the body::
|
|
|
|
|
|
|
|
@pytestbot please prepare release from 5.1.x
|
|
|
|
|
|
|
|
Where ``5.1.x`` is the maintenance branch for the ``5.1`` series.
|
|
|
|
|
2020-09-20 02:35:17 +08:00
|
|
|
The automated workflow will publish a PR for a branch ``release-5.1.2``
|
|
|
|
and notify it as a comment in the issue.
|
2020-08-02 00:46:35 +08:00
|
|
|
|
|
|
|
Minor releases
|
|
|
|
^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
1. Create a new maintenance branch from ``master``::
|
|
|
|
|
|
|
|
git fetch --all
|
|
|
|
git branch 5.2.x upstream/master
|
|
|
|
git push upstream 5.2.x
|
2020-03-02 01:46:35 +08:00
|
|
|
|
2020-08-02 00:46:35 +08:00
|
|
|
2. Open a new issue and add this comment to the body::
|
2020-03-02 01:46:35 +08:00
|
|
|
|
2020-08-02 00:46:35 +08:00
|
|
|
@pytestbot please prepare release from 5.2.x
|
2020-03-02 01:46:35 +08:00
|
|
|
|
2020-09-20 02:35:17 +08:00
|
|
|
The automated workflow will publish a PR for a branch ``release-5.2.0`` and
|
|
|
|
notify it as a comment in the issue.
|
2020-03-02 01:46:35 +08:00
|
|
|
|
2020-08-02 00:46:35 +08:00
|
|
|
Major and release candidates
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2020-07-28 19:40:14 +08:00
|
|
|
|
2020-08-02 00:46:35 +08:00
|
|
|
1. Create a new maintenance branch from ``master``::
|
2020-07-28 19:40:14 +08:00
|
|
|
|
2020-08-02 00:46:35 +08:00
|
|
|
git fetch --all
|
|
|
|
git branch 6.0.x upstream/master
|
|
|
|
git push upstream 6.0.x
|
|
|
|
|
|
|
|
2. For a **major release**, open a new issue and add this comment in the body::
|
|
|
|
|
|
|
|
@pytestbot please prepare major release from 6.0.x
|
|
|
|
|
|
|
|
For a **release candidate**, the comment must be (TODO: `#7551 <https://github.com/pytest-dev/pytest/issues/7551>`__)::
|
|
|
|
|
|
|
|
@pytestbot please prepare release candidate from 6.0.x
|
|
|
|
|
2020-09-20 02:35:17 +08:00
|
|
|
The automated workflow will publish a PR for a branch ``release-6.0.0`` and
|
|
|
|
notify it as a comment in the issue.
|
2020-08-02 00:46:35 +08:00
|
|
|
|
|
|
|
At this point on, this follows the same workflow as other maintenance branches: bug-fixes are merged
|
|
|
|
into ``master`` and ported back to the maintenance branch, even for release candidates.
|
|
|
|
|
|
|
|
**A note about release candidates**
|
|
|
|
|
|
|
|
During release candidates we can merge small improvements into
|
|
|
|
the maintenance branch before releasing the final major version, however we must take care
|
|
|
|
to avoid introducing big changes at this stage.
|
2020-03-02 01:46:35 +08:00
|
|
|
|
|
|
|
Preparing: Manual Method
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
2020-08-02 00:46:35 +08:00
|
|
|
**Important**: pytest releases must be prepared on **Linux** because the docs and examples expect
|
|
|
|
to be executed on that platform.
|
2016-02-14 03:29:30 +08:00
|
|
|
|
2020-01-25 22:31:21 +08:00
|
|
|
To release a version ``MAJOR.MINOR.PATCH``, follow these steps:
|
2015-11-19 00:55:18 +08:00
|
|
|
|
2020-08-02 00:46:35 +08:00
|
|
|
#. For major and minor releases, create a new branch ``MAJOR.MINOR.x`` from
|
|
|
|
``upstream/master`` and push it to ``upstream``.
|
2019-06-03 01:06:41 +08:00
|
|
|
|
2020-01-25 22:31:21 +08:00
|
|
|
#. Create a branch ``release-MAJOR.MINOR.PATCH`` from the ``MAJOR.MINOR.x`` branch.
|
2014-09-05 19:13:23 +08:00
|
|
|
|
2020-01-25 22:31:21 +08:00
|
|
|
Ensure your are updated and in a clean working tree.
|
2017-05-31 08:26:41 +08:00
|
|
|
|
2018-07-14 21:21:31 +08:00
|
|
|
#. Using ``tox``, generate docs, changelog, announcements::
|
2018-07-04 09:15:11 +08:00
|
|
|
|
2020-01-25 22:31:21 +08:00
|
|
|
$ tox -e release -- MAJOR.MINOR.PATCH
|
2016-08-20 05:50:46 +08:00
|
|
|
|
2018-07-14 21:21:31 +08:00
|
|
|
This will generate a commit with all the changes ready for pushing.
|
2017-05-31 08:26:41 +08:00
|
|
|
|
2020-01-25 22:31:21 +08:00
|
|
|
#. Open a PR for the ``release-MAJOR.MINOR.PATCH`` branch targeting ``MAJOR.MINOR.x``.
|
2017-05-31 08:26:41 +08:00
|
|
|
|
2020-03-02 01:46:35 +08:00
|
|
|
|
|
|
|
Releasing
|
|
|
|
~~~~~~~~~
|
|
|
|
|
|
|
|
Both automatic and manual processes described above follow the same steps from this point onward.
|
|
|
|
|
2020-01-25 22:31:21 +08:00
|
|
|
#. After all tests pass and the PR has been approved, tag the release commit
|
2020-09-20 02:35:17 +08:00
|
|
|
in the ``release-MAJOR.MINOR.PATCH`` branch and push it. This will publish to PyPI::
|
2015-07-26 21:20:32 +08:00
|
|
|
|
2020-09-20 02:35:17 +08:00
|
|
|
git fetch --all
|
|
|
|
git tag MAJOR.MINOR.PATCH upstream/release-MAJOR.MINOR.PATCH
|
2020-01-25 22:31:21 +08:00
|
|
|
git push git@github.com:pytest-dev/pytest.git MAJOR.MINOR.PATCH
|
2016-08-20 05:50:46 +08:00
|
|
|
|
2018-02-10 06:59:15 +08:00
|
|
|
Wait for the deploy to complete, then make sure it is `available on PyPI <https://pypi.org/project/pytest>`_.
|
2014-09-05 19:13:23 +08:00
|
|
|
|
2019-06-03 01:06:41 +08:00
|
|
|
#. Merge the PR.
|
|
|
|
|
2020-01-25 22:31:21 +08:00
|
|
|
#. Cherry-pick the CHANGELOG / announce files to the ``master`` branch::
|
2019-06-03 01:06:41 +08:00
|
|
|
|
|
|
|
git fetch --all --prune
|
2020-01-25 22:31:21 +08:00
|
|
|
git checkout origin/master -b cherry-pick-release
|
2020-08-02 00:46:35 +08:00
|
|
|
git cherry-pick -x -m1 upstream/MAJOR.MINOR.x
|
2020-07-29 22:29:24 +08:00
|
|
|
|
|
|
|
#. Open a PR for ``cherry-pick-release`` and merge it once CI passes. No need to wait for approvals if there were no conflicts on the previous step.
|
2018-08-30 05:13:08 +08:00
|
|
|
|
2020-10-18 00:08:48 +08:00
|
|
|
#. For major and minor releases, tag the release cherry-pick merge commit in master with
|
|
|
|
a dev tag for the next feature release::
|
|
|
|
|
|
|
|
git checkout master
|
|
|
|
git pull
|
|
|
|
git tag MAJOR.{MINOR+1}.0.dev0
|
|
|
|
git push git@github.com:pytest-dev/pytest.git MAJOR.{MINOR+1}.0.dev0
|
|
|
|
|
2018-02-10 06:59:15 +08:00
|
|
|
#. Send an email announcement with the contents from::
|
2014-09-05 19:13:23 +08:00
|
|
|
|
2018-02-10 06:59:15 +08:00
|
|
|
doc/en/announce/release-<VERSION>.rst
|
2014-09-05 19:13:23 +08:00
|
|
|
|
2018-02-10 06:59:15 +08:00
|
|
|
To the following mailing lists:
|
2017-05-31 08:26:41 +08:00
|
|
|
|
2018-02-10 06:59:15 +08:00
|
|
|
* pytest-dev@python.org (all releases)
|
|
|
|
* python-announce-list@python.org (all releases)
|
|
|
|
* testing-in-python@lists.idyll.org (only major/minor releases)
|
2015-07-26 21:20:32 +08:00
|
|
|
|
2018-02-10 06:59:15 +08:00
|
|
|
And announce it on `Twitter <https://twitter.com/>`_ with the ``#pytest`` hashtag.
|