|
1 |
| -# Releasing a pylint version |
| 1 | +# Releasing an astroid version |
2 | 2 |
|
3 |
| -So, you want to release the `X.Y.Z` version of pylint ? |
| 3 | +So, you want to release the `X.Y.Z` version of astroid ? |
4 | 4 |
|
5 |
| -## Process |
| 5 | +## Releasing a major or minor version |
6 | 6 |
|
7 |
| -1. Check if the dependencies of the package are correct, make sure that astroid is |
8 |
| - pinned to the latest version. |
9 |
| -2. Install the release dependencies `pip3 install pre-commit tbump tox` |
10 |
| -3. Bump the version by using `tbump X.Y.Z --no-tag --no-push` |
11 |
| -4. Check the result (Do `git diff vX.Y.Z-1 ChangeLog doc/whatsnew/` in particular). |
12 |
| -5. Move back to a dev version for pylint with `tbump`: |
| 7 | +**Before releasing a major or minor version check if there are any unreleased commits on |
| 8 | +the maintenance branch. If so, release a last patch release first. See |
| 9 | +`Releasing a patch version`.** |
| 10 | + |
| 11 | +- Remove the empty changelog for the last unreleased patch version `X.Y-1.Z'`. (For |
| 12 | + example: `v2.3.5`) |
| 13 | +- Check the result of `git diff vX.Y-1.Z' ChangeLog`. (For example: |
| 14 | + `git diff v2.3.4 ChangeLog`) |
| 15 | +- Install the release dependencies: `pip3 install -r requirements_test.txt` |
| 16 | +- Bump the version and release by using `tbump X.Y.0 --no-push --no-tag`. (For example: |
| 17 | + `tbump 2.4.0 --no-push --no-tag`) |
| 18 | +- Check the commit created with `git show` amend the commit if required. |
| 19 | +- Move the `main` branch up to a dev version with `tbump`: |
13 | 20 |
|
14 | 21 | ```bash
|
15 |
| -tbump X.Y.Z+1-dev0 --no-tag --no-push # You can interrupt after the first step |
16 |
| -git commit -am "Move back to a dev version following X.Y.Z release" |
| 22 | +tbump X.Y+1.0-dev0 --no-tag --no-push # You can interrupt after the first step |
| 23 | +git commit -am "Upgrade the version to x.y+1.0-dev0 following x.y.0 release" |
17 | 24 | ```
|
18 | 25 |
|
19 |
| -4. Check the result |
20 |
| -5. Open a merge request with the two commits (no one can push directly on `main`) |
21 |
| -6. After the merge recover the merged commits and tag the first one (the version should |
22 |
| - be `X.Y.Z`) as `vX.Y.Z` |
23 |
| -7. Push the tag |
24 |
| -8. Go to GitHub, click on "Releases" then on the `vX.Y.Z` tag, choose edit tag, and copy |
25 |
| - past the changelog in the description. This will trigger the release to pypi. |
| 26 | +For example: |
26 | 27 |
|
27 |
| -## Post release |
| 28 | +```bash |
| 29 | +tbump 2.5.0-dev0 --no-tag --no-push |
| 30 | +git commit -am "Upgrade the version to 2.5.0-dev0 following 2.4.0 release" |
| 31 | +``` |
28 | 32 |
|
29 |
| -### Merge tags in main for pre-commit |
| 33 | +Check the commit and then push to a release branch |
30 | 34 |
|
31 |
| -If the tag you just made is not part of the main branch, merge the tag `vX.Y.Z` in the |
32 |
| -main branch by doing a history only merge. It's done in order to signal that this is an |
33 |
| -official release tag, and for `pre-commit autoupdate` to works. |
| 35 | +- Open a merge request with the two commits (no one can push directly on `main`) |
| 36 | +- Trigger the "release tests" workflow in GitHub Actions. |
| 37 | +- After the merge, recover the merged commits on `main` and tag the first one (the |
| 38 | + version should be `X.Y.Z`) as `vX.Y.Z` (For example: `v2.4.0`) |
| 39 | +- Push the tag. |
| 40 | +- Release the version on GitHub with the same name as the tag and copy and paste the |
| 41 | + appropriate changelog in the description. This triggers the PyPI release. |
| 42 | +- Delete the `maintenance/X.Y-1.x` branch. (For example: `maintenance/2.3.x`) |
| 43 | +- Create a `maintenance/X.Y.x` (For example: `maintenance/2.4.x` from the `v2.4.0` tag.) |
34 | 44 |
|
35 |
| -```bash |
36 |
| -git checkout main |
37 |
| -git merge --no-edit --strategy=ours vX.Y.Z |
38 |
| -git push |
39 |
| -``` |
| 45 | +## Backporting a fix from `main` to the maintenance branch |
| 46 | + |
| 47 | +Whenever a commit on `main` should be released in a patch release on the current |
| 48 | +maintenance branch we cherry-pick the commit from `main`. |
| 49 | + |
| 50 | +- During the merge request on `main`, make sure that the changelog is for the patch |
| 51 | + version `X.Y-1.Z'`. (For example: `v2.3.5`) |
| 52 | +- After the PR is merged on `main` cherry-pick the commits on the `maintenance/X.Y.x` |
| 53 | + branch (For example: from `maintenance/2.4.x` cherry-pick a commit from `main`) |
| 54 | +- Release a patch version |
40 | 55 |
|
41 |
| -### Milestone handling |
| 56 | +## Releasing a patch version |
42 | 57 |
|
43 |
| -We move issue that were not done in the next milestone and block release only if it's an |
44 |
| -issue labelled as blocker. |
| 58 | +We release patch versions when a crash or a bug is fixed on the main branch and has been |
| 59 | +cherry-picked on the maintenance branch. |
45 | 60 |
|
46 |
| -- Close milestone `X.Y.Z` |
47 |
| -- Create the milestones for `X.Y.Z+1`, (or `X.Y+1.0`, and `X+1.0.0` if applicable) |
| 61 | +- Check the result of `git diff vX.Y-1.Z-1 ChangeLog`. (For example: |
| 62 | + `git diff v2.3.4 ChangeLog`) |
| 63 | +- Install the release dependencies: `pip3 install -r requirements_test.txt` |
| 64 | +- Bump the version and release by using `tbump X.Y-1.Z --no-push`. (For example: |
| 65 | + `tbump 2.3.5 --no-push`) |
| 66 | +- Check the result visually and then by triggering the "release tests" workflow in |
| 67 | + GitHub Actions first. |
| 68 | +- Push the tag. |
| 69 | +- Release the version on GitHub with the same name as the tag and copy and paste the |
| 70 | + appropriate changelog in the description. This triggers the PyPI release. |
| 71 | +- Merge the `maintenance/X.Y.x` branch on the main branch. The main branch should have |
| 72 | + the changelog for `X.Y-1.Z+1` (For example `v2.3.6`). This merge is required so |
| 73 | + `pre-commit autoupdate` works for pylint. |
| 74 | +- Fix version conflicts properly, or bump the version to `X.Y.0-devZ` (For example: |
| 75 | + `2.4.0-dev6`) before pushing on the main branch |
48 | 76 |
|
49 |
| -#### What's new |
| 77 | +## Milestone handling |
50 | 78 |
|
51 |
| -If it's a minor release, create a new `What's new in Pylint X.Y+1` document. Add it to |
52 |
| -`doc/index.rst`. Take a look at the examples from `doc/whatsnew`. |
| 79 | +We move issues that were not done to the next milestone and block releases only if there |
| 80 | +are any open issues labelled as `blocker`. |
0 commit comments