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-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
|
|
|
|
by opening an issue or issuing a comment one.
|
|
|
|
|
|
|
|
The comment must be in the form::
|
|
|
|
|
|
|
|
@pytestbot please prepare release from BRANCH
|
|
|
|
|
|
|
|
Where ``BRANCH`` is ``master`` or one of the maintenance branches.
|
|
|
|
|
|
|
|
After that, the workflow should publish a PR and notify that it has done so as a comment
|
|
|
|
in the original issue.
|
|
|
|
|
|
|
|
Preparing: Manual Method
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
2017-05-16 07:23:04 +08:00
|
|
|
.. important::
|
2015-07-26 21:20:32 +08:00
|
|
|
|
2017-05-31 08:26:41 +08:00
|
|
|
pytest releases must be prepared on **Linux** because the docs and examples expect
|
2020-01-23 05:50:32 +08:00
|
|
|
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-01-25 22:31:21 +08:00
|
|
|
#. For major and minor releases, create a new branch ``MAJOR.MINOR.x`` from the
|
|
|
|
latest ``master`` and push it to the ``pytest-dev/pytest`` repo.
|
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
|
|
|
|
in the ``MAJOR.MINOR.x`` branch and push it. This will publish to PyPI::
|
2015-07-26 21:20:32 +08:00
|
|
|
|
2020-01-25 22:31:21 +08:00
|
|
|
git tag MAJOR.MINOR.PATCH
|
|
|
|
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
|
|
|
|
git cherry-pick --no-commit -m1 origin/MAJOR.MINOR.x
|
2019-06-03 01:06:41 +08:00
|
|
|
git checkout origin/master -- changelog
|
|
|
|
git commit # no arguments
|
2018-08-30 05:13:08 +08:00
|
|
|
|
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.
|