22Releasing unittest2pytest
33=========================
44
5- This document describes the steps to make a new ``unittest2pytest `` release.
5+ ``unittest2pytest `` uses `setuptools-scm `_ for version management.
6+ Versions are derived automatically from git tags.
7+
8+ .. _setuptools-scm : https://github.com/pypa/setuptools-scm
9+
610
711Version
812-------
913
10- ``main `` should always be green and a potential release candidate. ``unittest2pytest `` follows
11- semantic versioning, so given that the current version is ``X.Y.Z ``, to find the next version number
12- one needs to look at the ``CHANGELOG.rst `` file:
14+ ``main `` should always be green and a potential release candidate.
15+ ``unittest2pytest `` follows semantic versioning, so given that the
16+ current version is ``X.Y.Z ``, to find the next version number one
17+ needs to look at the ``CHANGELOG.rst `` file:
1318
14- - If there any new feature, then we must make a new **minor ** release: next
15- release will be ``X.Y+1.0 ``.
19+ - If there any new feature, then we must make a new **minor ** release:
20+ next release will be ``X.Y+1.0 ``.
1621
1722- Otherwise it is just a **bug fix ** release: ``X.Y.Z+1 ``.
1823
@@ -22,20 +27,46 @@ Steps
2227
2328To publish a new release ``X.Y.Z ``, the steps are as follows:
2429
25- #. Create a new branch named ``release-X.Y.Z `` from the latest ``main ``.
30+ #. Update ``CHANGELOG.rst ``:
31+
32+ .. code-block :: console
2633
27- #. Update the version in `` unittest2pytest/__init__ .py``.
34+ python make_changelog .py X.Y.Z
2835
29- #. Update the ``CHANGELOG.rst `` file with the new release information.
36+ This replaces the ``UNRELEASED `` section with a dated ``X.Y.Z ``
37+ section. Review the result and add any missing entries before
38+ committing.
39+
40+ #. Commit and push:
41+
42+ .. code-block :: console
3043
31- #. Commit and push the branch to ``upstream `` and open a PR.
44+ git commit -am "Prepare release X.Y.Z"
45+ git push origin main
3246
33- #. Once the PR is ** green ** and ** approved **, start the `` deploy `` workflow :
47+ #. Tag and push :
3448
3549 .. code-block :: console
3650
37- gh workflow run deploy.yml -R pytest-dev/unittest2pytest --ref release-VERSION --field version=VERSION
51+ git tag -s vX.Y.Z -m "unittest2pytest X.Y.Z"
52+ git push origin vX.Y.Z
53+
54+ Pushing the tag triggers the CI workflow, which builds, tests,
55+ publishes to PyPI, and creates a GitHub release.
56+
57+ #. Start the next development cycle:
58+
59+ .. code-block :: console
60+
61+ python make_changelog.py UNRELEASED
62+ git commit -am "Start next development cycle"
63+ git push origin main
64+
3865
39- The PR will be automatically merged.
66+ How versioning works
67+ --------------------
4068
41- #. Update the version in ``unittest2pytest/__init__.py `` and ``CHANGELOG.rst `` for the next release (usually use "minor+1" with the ``.dev0 `` suffix).
69+ - Tagged commits (e.g. ``v0.6 ``) produce version ``0.6 ``.
70+ - Commits after a tag produce dev versions like ``0.7.dev3+gabcdef ``.
71+ - The version is written to ``unittest2pytest/_version.py `` at build
72+ time. This file is git-ignored and should not be committed.
0 commit comments