|
1 | 1 | # Making a release |
2 | 2 |
|
3 | | -This is a guide on how to make a release of scanpy for maintainers. |
| 3 | +First, check out {doc}`versioning` to see which kind of release you want to make. |
| 4 | +That page also explains concepts like *pre-releases* and applications thereof. |
4 | 5 |
|
5 | | -## Checking that PyPI will accept it |
| 6 | +## Actually making the release |
6 | 7 |
|
7 | | -Sometimes PyPI will reject a build. |
8 | | -You can locally check whether the build is acceptable with `twine check`. |
| 8 | +1. Go to GitHub’s [releases][] page |
| 9 | +2. Click “Draft a new release” |
| 10 | +3. Click “Choose a tag” and type the version of the tag you want to release, such as `1.9.6` |
| 11 | +4. Click “**+ Create new tag: 1.\<minor>.\<patch>** on publish” |
| 12 | +5. If the version is a *pre-release* version, such as `1.7.0rc1` or `1.10.0a1`, tick the “Set as a pre-release” checkbox |
9 | 13 |
|
10 | | -```shell |
11 | | -# First, make a build |
12 | | -python -m build |
| 14 | +[releases]: https://github.com/scverse/scanpy/releases |
13 | 15 |
|
14 | | -# Now check that build |
15 | | -twine check dist/* # Assuming dist is otherwise empty |
16 | | -``` |
| 16 | +## After making a release |
17 | 17 |
|
18 | | -## Actually making release |
| 18 | +After *any* release has been made: |
19 | 19 |
|
20 | | -First, make sure you're working repository is clean and is on the commit you'd like to release from. |
21 | | -Then follow these steps: |
| 20 | +- Create a new release notes file for the next bugfix release. |
| 21 | + This should be included in both dev and stable branches. |
| 22 | +- Create a milestone for the next release (in case you made a bugfix release) or releases (in case of a major/minor release). |
| 23 | + For bugfix releases, this should have `on-merge: backport to 0.<minor>.x`, |
| 24 | + so the [meeseeksdev][] bot will create a backport PR. See {doc}`versioning` for more info. |
| 25 | +- Clear out and close the milestone you just made a release for. |
22 | 26 |
|
23 | | -```shell |
24 | | -# Tag the commit with version info |
25 | | -git tag {version} # where version is a version number like "1.7.0" |
| 27 | +After a *major* or *minor* release has been made: |
| 28 | + |
| 29 | +- Tweet about it! Announce it on Zulip! Announce it on Discourse! Think about making a bot for this! Maybe actually do that? |
| 30 | +- Create a new release notes file for the next minor release. This should only be added to the dev branch. |
| 31 | +- Tag the development branch. If you just released `1.7.0`, this would be `1.8.0.dev0`. |
| 32 | +- Create a new branch for this release series, like `1.7.x`. This should get a new release notes file. |
| 33 | + |
| 34 | +[meeseeksdev]: https://meeseeksbox.github.io |
| 35 | + |
| 36 | +## Debugging the build process |
| 37 | + |
| 38 | +If you changed something about the build process (e.g. [Hatchling’s build configuration][hatch-build]), |
| 39 | +or something about the package’s structure, |
| 40 | +you might want to manually check if the build and upload process behaves as expected: |
26 | 41 |
|
| 42 | +```shell |
27 | 43 | # Clear out old distributions |
28 | 44 | rm -r dist |
29 | 45 |
|
30 | | -# Build distributions and wheel |
| 46 | +# Build source distribution and wheel both |
31 | 47 | python -m build |
32 | | -# you can check that the previous step worked by installing from it's results |
33 | | -# e.g. pip install dist/scanpy-{version}-py3-none-any.whl |
34 | | - |
35 | | -# Once you're confident the build looks good, push the tag to github |
36 | | -git push upstream {version} |
37 | | - |
38 | | -# Upload wheel and code distribution to pypi |
39 | | -twine upload dist/scanpy-{version} |
40 | | -``` |
41 | 48 |
|
42 | | -### Checking the distributions |
| 49 | +# Now check those build artifacts |
| 50 | +twine check dist/* |
43 | 51 |
|
44 | | -If you're feeling cautious, you can: |
| 52 | +# List the wheel archive’s contents |
| 53 | +bsdtar -tf dist/*.whl |
45 | 54 |
|
46 | | -- List the contents of a wheel with: `unzip -l dist/*.whl` |
47 | | -- Make a release candidate. Tag these with `{version}rc1` (e.g. `1.7.0rc1`) |
48 | | -- Upload them to <test.pypi.org> ([tutorial](https://packaging.python.org/en/latest/tutorials/packaging-projects/#uploading-the-distribution-archives)) |
| 55 | +``` |
49 | 56 |
|
50 | | -## After making a release |
| 57 | +You can also upload the package to <test.pypi.org> ([tutorial][testpypi tutorial]) |
51 | 58 |
|
52 | | -After a major or minor release has been made: |
| 59 | +[testpypi tutorial]: https://packaging.python.org/en/latest/tutorials/packaging-projects/#uploading-the-distribution-archives |
53 | 60 |
|
54 | | -- Tweet about it! Announce it on Zulip! Announce it on Discourse! Think about making a bot for this! Maybe actually do that? |
55 | | -- Create a new release notes file for the next minor release. This should only be added to the dev branch. |
56 | | -- Tag the development branch. If you just released `1.7.0`, this would be `1.8.0.dev0`. |
57 | | -- Create a new branch for this release series, like `1.7.x`. This should get a new release notes file. |
| 61 | +``` |
| 62 | +twine upload --repository testpypi dist/* |
| 63 | +``` |
58 | 64 |
|
59 | | -After any release has been made: |
| 65 | +The above approximates what the [publish workflow][] does automatically for us. |
| 66 | +If you want to replicate the process more exactly, make sure you are careful, |
| 67 | +and create a version tag before building (make sure you delete it after uploading to TestPyPI!). |
60 | 68 |
|
61 | | -- Create a new release notes file for the next bugfix release. This should be included in both dev and stable branches `release-latest.md` |
62 | | -- Create a milestone for the next release(s). For bugfix releases, this should have `on-merge: backport to 0.8.x` so [meeseeksdev](https://meeseeksbox.github.io) bot will create a backport PR. See {doc}`versioning` for more info. |
| 69 | +[hatch-build]: https://hatch.pypa.io/latest/config/build/ |
| 70 | +[publish workflow]: https://github.com/scverse/scanpy/tree/master/.github/workflows/publish.yml |
0 commit comments