2015-07-26 21:20:32 +08:00
How to release pytest
2014-09-05 19:13:23 +08:00
--------------------------------------------
2017-05-10 09:55:27 +08:00
Note: this assumes you have already registered on PyPI and you have
`invoke <https://pypi.org/project/invoke/> `_ installed.
2015-07-26 21:20:32 +08:00
2016-08-29 21:53:41 +08:00
#. Check and finalize `` CHANGELOG.rst `` .
2016-02-14 03:29:30 +08:00
2017-05-10 09:55:27 +08:00
#. Generate a new release announcement::
2014-09-05 19:13:23 +08:00
2017-05-10 09:55:27 +08:00
invoke generate.announce VERSION
Feel free to modify the generated files before committing.
2015-11-19 00:55:18 +08:00
2016-08-29 21:53:41 +08:00
#. Regenerate the docs examples using tox::
2014-09-05 19:13:23 +08:00
2017-05-10 09:55:27 +08:00
tox -e regen
2016-08-20 05:50:46 +08:00
2016-08-29 21:53:41 +08:00
#. At this point, open a PR named `` release-X `` so others can help find regressions or provide suggestions.
2016-08-20 05:50:46 +08:00
2016-08-29 21:53:41 +08:00
#. Use devpi for uploading a release tarball to a staging area::
2015-07-26 21:20:32 +08:00
2015-09-26 10:10:35 +08:00
devpi use https://devpi.net/USER/dev
devpi upload --formats sdist,bdist_wheel
2015-07-26 21:20:32 +08:00
2016-08-29 21:53:41 +08:00
#. Run from multiple machines::
2015-07-26 21:20:32 +08:00
2015-09-26 10:10:35 +08:00
devpi use https://devpi.net/USER/dev
devpi test pytest==VERSION
2015-07-26 21:20:32 +08:00
2016-08-20 05:50:46 +08:00
Alternatively, you can use `devpi-cloud-tester <https://github.com/nicoddemus/devpi-cloud-tester> `_ to test
the package on AppVeyor and Travis (follow instructions on the `` README `` ).
2016-08-29 21:53:41 +08:00
#. Check that tests pass for relevant combinations with::
2014-09-05 19:13:23 +08:00
2015-09-26 10:10:35 +08:00
devpi list pytest
2014-09-05 19:13:23 +08:00
or look at failures with "devpi list -f pytest".
2016-08-29 21:53:41 +08:00
#. Feeling confident? Publish to pypi::
2015-07-26 21:20:32 +08:00
2016-08-20 05:50:46 +08:00
devpi push pytest==VERSION pypi:NAME
2015-05-19 16:32:21 +08:00
2016-08-20 05:50:46 +08:00
where NAME is the name of pypi.python.org as configured in your `` ~/.pypirc ``
file `for devpi <http://doc.devpi.net/latest/quickstart-releaseprocess.html?highlight=pypirc#devpi-push-releasing-to-an-external-index> `_ .
2015-07-26 21:20:32 +08:00
2016-08-29 21:53:41 +08:00
#. Tag the release::
2015-07-26 21:20:32 +08:00
2016-08-20 05:50:46 +08:00
git tag VERSION <hash>
git push origin VERSION
2014-09-05 19:13:23 +08:00
2016-08-20 05:50:46 +08:00
Make sure `` <hash> `` is **exactly** the git hash at the time the package was created.
2015-07-26 21:20:32 +08:00
2016-08-29 21:53:41 +08:00
#. Send release announcement to mailing lists:
2015-07-26 21:20:32 +08:00
2016-08-20 05:50:46 +08:00
- pytest-dev@python.org
- python-announce-list@python.org
2016-09-02 23:27:06 +08:00
- testing-in-python@lists.idyll.org (only for minor/major releases)
2015-07-26 21:20:32 +08:00
2016-08-20 05:50:46 +08:00
And announce the release on Twitter, making sure to add the hashtag `` #pytest `` .
2015-07-26 21:20:32 +08:00
2016-08-29 21:53:41 +08:00
#. **After the release**
2015-07-26 21:20:32 +08:00
2016-08-20 05:50:46 +08:00
a. **patch release (2.8.3)** :
2015-07-26 21:20:32 +08:00
2016-08-20 05:50:46 +08:00
1. Checkout `` master `` .
2016-09-02 08:34:54 +08:00
2. Update version number in `` _pytest/__init__.py `` to `` "2.8.4.dev0" `` .
3. Create a new section in `` CHANGELOG.rst `` titled `` 2.8.4.dev0 `` and add a few bullet points as placeholders for new entries.
2016-08-20 05:50:46 +08:00
4. Commit and push.
2015-07-26 21:20:32 +08:00
2016-08-20 05:50:46 +08:00
b. **minor release (2.9.0)** :
2015-07-26 21:20:32 +08:00
2016-08-20 05:50:46 +08:00
1. Merge `` features `` into `` master `` .
2. Checkout `` master `` .
2016-09-02 08:34:54 +08:00
3. Follow the same steps for a **patch release** above, using the next patch release: `` 2.9.1.dev0 `` .
2016-08-20 05:50:46 +08:00
4. Commit `` master `` .
5. Checkout `` features `` and merge with `` master `` (should be a fast-forward at this point).
2016-09-02 08:34:54 +08:00
6. Update version number in `` _pytest/__init__.py `` to the next minor release: `` "2.10.0.dev0" `` .
7. Create a new section in `` CHANGELOG.rst `` titled `` 2.10.0.dev0 `` , above `` 2.9.1.dev0 `` , and add a few bullet points as placeholders for new entries.
2016-08-20 05:50:46 +08:00
8. Commit `` features `` .
9. Push `` master `` and `` features `` .
2014-09-05 19:13:23 +08:00
2016-08-20 05:50:46 +08:00
c. **major release (3.0.0)** : same steps as that of a **minor release**