|
| 1 | +Releasing a pylint version |
| 2 | +========================== |
| 3 | + |
| 4 | +So, you want to release the ``X.Y.Z`` version of pylint ? |
| 5 | + |
| 6 | +Releasing a major or minor version |
| 7 | +---------------------------------- |
| 8 | + |
| 9 | +**Before releasing a major or minor version check if there are any |
| 10 | +unreleased commits on the maintenance branch. If so, release a last |
| 11 | +patch release first. See ``Releasing a patch version``.** |
| 12 | + |
| 13 | +- Write the ``Summary -- Release highlights`` in ``doc/whatsnew`` and |
| 14 | + upgrade the release date. |
| 15 | +- Install the release dependencies: |
| 16 | + ``pip3 install -r requirements_test.txt`` |
| 17 | +- Bump the version and release by using |
| 18 | + ``tbump X.Y.0 --no-push --no-tag``. (For example: |
| 19 | + ``tbump 2.4.0 --no-push --no-tag``) |
| 20 | +- Check the commit created with ``git show`` amend the commit if |
| 21 | + required. |
| 22 | +- Create a new ``What's new in Pylint X.Y+1`` document. Add it to |
| 23 | + ``doc/index.rst``. Take a look at the examples from ``doc/whatsnew``. |
| 24 | + Commit that with ``git commit -am "wip"``. |
| 25 | +- Move the ``main`` branch up to a dev version with ``tbump``: |
| 26 | + |
| 27 | +.. code:: bash |
| 28 | +
|
| 29 | + tbump X.Y+1.0-dev0 --no-tag --no-push # You can interrupt after the first step |
| 30 | + git commit -am "Upgrade the version to x.y+1.0-dev0 following x.y.0 release" |
| 31 | +
|
| 32 | +For example: |
| 33 | + |
| 34 | +.. code:: bash |
| 35 | +
|
| 36 | + tbump 2.5.0-dev0 --no-tag --no-push |
| 37 | + git commit -am "Upgrade the version to 2.5.0-dev0 following 2.4.0 release" |
| 38 | +
|
| 39 | +Check the commit, fixup the ‘wip’ commit with the what’s new then push |
| 40 | +to a release branch |
| 41 | + |
| 42 | +- Open a merge request with the two commits (no one can push directly |
| 43 | + on ``main``) |
| 44 | +- After the merge, recover the merged commits on ``main`` and tag the |
| 45 | + first one (the version should be ``X.Y.Z``) as ``vX.Y.Z`` (For |
| 46 | + example: ``v2.4.0``) |
| 47 | +- Push the tag. |
| 48 | +- Release the version on GitHub with the same name as the tag and copy |
| 49 | + and paste the appropriate changelog in the description. This triggers |
| 50 | + the PyPI release. |
| 51 | +- Create a ``maintenance/X.Y.x`` (For example: ``maintenance/2.4.x`` |
| 52 | + from the ``v2.4.0`` tag.) |
| 53 | +- Upgrade the pattern for the protected branches in the settings under |
| 54 | + ``Branches`` / ``Branch protection rules``. (For example: |
| 55 | + ``maintenance/2.4*`` instead of ``maintenance/2.3*``.). There’s a lot |
| 56 | + of configuration done in these settings, do NOT recreate it from |
| 57 | + scratch. |
| 58 | +- Delete the ``maintenance/X.Y-1.x`` branch. (For example: |
| 59 | + ``maintenance/2.3.x``) |
| 60 | +- Select all the issues labelled ``backport maintenance/X.Y-1.x`` and |
| 61 | + label them ``backported``, then rename the |
| 62 | + ``backport maintenance/X.Y-1.x`` label to |
| 63 | + ``backport maintenance/X.Y.x`` (for example rename |
| 64 | + ``backport maintenance/2.3.x`` to ``backport maintenance/2.4.x``) |
| 65 | +- Close the current milestone and create the new ones (For example: |
| 66 | + close ``2.4.0``, create ``2.4.1`` and ``2.6.0``) |
| 67 | +- Hide and deactivate all the patch releases for the previous minor |
| 68 | + release on |
| 69 | + `readthedoc <https://readthedocs.org/projects/pylint/versions/>`__, |
| 70 | + except the last one. (For example: hide ``v2.4.0``, ``v2.4.1``, |
| 71 | + ``v2.4.2`` and keep only ``v2.4.3``) |
| 72 | + |
| 73 | +Back-porting a fix from ``main`` to the maintenance branch |
| 74 | +---------------------------------------------------------- |
| 75 | + |
| 76 | +Whenever a PR on ``main`` should be released in a patch release on the |
| 77 | +current maintenance branch: |
| 78 | + |
| 79 | +- Label the PR with ``backport maintenance/X.Y-1.x``. (For example |
| 80 | + ``backport maintenance/2.3.x``) |
| 81 | +- Squash the PR before merging (alternatively rebase if there’s a |
| 82 | + single commit) |
| 83 | +- (If the automated cherry-pick has conflicts) |
| 84 | + |
| 85 | + - Add a ``Needs backport`` label and do it manually. |
| 86 | + - You might alternatively also: |
| 87 | + |
| 88 | + - Cherry-pick the changes that create the conflict if it’s not a |
| 89 | + new feature before doing the original PR cherry-pick manually. |
| 90 | + - Decide to wait for the next minor to release the PR |
| 91 | + - In any case upgrade the milestones in the original PR and newly |
| 92 | + cherry-picked PR to match reality. |
| 93 | + |
| 94 | +- Release a patch version |
| 95 | + |
| 96 | +Releasing a patch version |
| 97 | +------------------------- |
| 98 | + |
| 99 | +We release patch versions when a crash or a bug is fixed on the main |
| 100 | +branch and has been cherry-picked on the maintenance branch. |
| 101 | + |
| 102 | +- Install the release dependencies: |
| 103 | + ``pip3 install -r requirements_test.txt`` |
| 104 | +- Bump the version and release by using ``tbump X.Y-1.Z --no-push``. |
| 105 | + (For example: ``tbump 2.3.5 --no-push``) |
| 106 | +- Check the result visually with ``git show``. |
| 107 | +- Open a merge request of ``release-X.Y-1.Z'`` in ``maintenance/X.Y.x`` |
| 108 | + (For example: ``release-2.3.5-branch`` in ``maintenance/2.3.x``) to |
| 109 | + run the CI tests for this branch. |
| 110 | +- Create and push the tag. |
| 111 | +- Release the version on GitHub with the same name as the tag and copy |
| 112 | + and paste the changelog from the ReadtheDoc generated documentation |
| 113 | + from the pull request pipeline in the description. This triggers the |
| 114 | + PyPI release. |
| 115 | +- Merge the ``maintenance/X.Y.x`` branch on the main branch. The main |
| 116 | + branch should have the changelog for ``X.Y-1.Z+1`` (For example |
| 117 | + ``v2.3.6``). This merge is required so ``pre-commit autoupdate`` |
| 118 | + works for pylint. |
| 119 | +- Fix version conflicts properly, or bump the version to ``X.Y.0-devZ`` |
| 120 | + (For example: ``2.4.0-dev6``) before pushing on the main branch |
| 121 | +- Close the current milestone and create the new one (For example: |
| 122 | + close ``2.3.5``, create ``2.3.6``) |
| 123 | + |
| 124 | +Milestone handling |
| 125 | +------------------ |
| 126 | + |
| 127 | +We move issues that were not done to the next milestone and block |
| 128 | +releases only if there are any open issues labelled as ``blocker``. |
0 commit comments