All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
3 _Black_ has had a lot of work automating its release process. This document sets out to
4 explain what everything does and how to release _Black_ using said automation.
8 To cut a release, you must be a _Black_ maintainer with `GitHub Release` creation
9 access. Using this access, the release process is:
11 1. Cut a new PR editing `CHANGES.md` and the docs to version the latest changes
12 1. Remove any empty sections for the current release
13 2. Add a new empty template for the next release (template below)
14 3. Example PR: [#2616](https://github.com/psf/black/pull/2616)
15 4. Example title: `Update CHANGES.md for XX.X release`
16 2. Once the release PR is merged ensure all CI passes
17 1. If not, ensure there is an Issue open for the cause of failing CI (generally we'd
18 want this fixed before cutting a release)
19 3. Open `CHANGES.md` and copy the _raw markdown_ of the latest changes to use in the
20 description of the GitHub Release.
21 4. Go and [cut a release](https://github.com/psf/black/releases) using the GitHub UI so
22 that all workflows noted below are triggered.
23 1. The release version and tag should be the [CalVer](https://calver.org) version
24 _Black_ used for the current release e.g. `21.6` / `21.5b1`
25 2. _Black_ uses [setuptools scm](https://pypi.org/project/setuptools-scm/) to pull
26 the current version for the package builds and release.
27 5. Once the release is cut, you're basically done. It's a good practice to go and watch
28 to make sure all the [GitHub Actions](https://github.com/psf/black/actions) pass,
29 although you should receive an email to your registered GitHub email address should
31 1. You should see all the release workflows and lint/unittests workflows running on
32 the new tag in the Actions UI
34 If anything fails, please go read the respective action's log output and configuration
35 file to reverse engineer your way to a fix/soluton.
39 Use the following template for a clean changelog after the release:
46 <!-- Include any especially major or disruptive changes here -->
50 <!-- Changes that affect Black's style -->
54 <!-- Changes to blackd -->
58 <!-- Changes to how Black can be configured -->
62 <!-- Major changes to documentation and policies. Small docs changes
63 don't need a changelog entry. -->
67 <!-- For example, Docker, GitHub Actions, pre-commit, editors -->
71 <!-- Changes to Black's terminal output and error messages -->
75 <!-- Changes to how Black is packaged, such as dependency requirements -->
79 <!-- Changes to the parser or to version autodetection -->
83 <!-- Changes that improve Black's performance. -->
89 All _Blacks_'s automation workflows use GitHub Actions. All workflows are therefore
90 configured using `.yml` files in the `.github/workflows` directory of the _Black_
93 Below are descriptions of our release workflows.
97 This workflow uses the QEMU powered `buildx` feature of docker to upload a `arm64` and
98 `amd64`/`x86_64` build of the official _Black_ docker image™.
100 - Currently this workflow uses an API Token associated with @cooperlees account
104 This workflow builds a Python
105 [sdist](https://docs.python.org/3/distutils/sourcedist.html) and
106 [wheel](https://pythonwheels.com) using the latest
107 [setuptools](https://pypi.org/project/setuptools/) and
108 [wheel](https://pypi.org/project/wheel/) modules.
110 It will then use [twine](https://pypi.org/project/twine/) to upload both release formats
111 to PyPI for general downloading of the _Black_ Python package. This is where
112 [pip](https://pypi.org/project/pip/) looks by default.
114 - Currently this workflow uses an API token associated with @ambv's PyPI account
116 ### Upload self-contained binaries
118 This workflow builds self-contained binaries for multiple platforms. This allows people
119 to download the executable for their platform and run _Black_ without a
120 [Python Runtime](https://wiki.python.org/moin/PythonImplementations) installed.
122 The created binaries are attached/stored on the associated
123 [GitHub Release](https://github.com/psf/black/releases) for download over _IPv4 only_
124 (GitHub still does not have IPv6 access 😢).
126 ## Moving the `stable` tag
128 _Black_ provides a stable tag for people who want to move along as _Black_ developers
129 deem the newest version reliable. Here the _Black_ developers will move once the release
130 has been problem free for at least ~24 hours from release. Given the large _Black_
131 userbase we hear about bad bugs quickly. We do strive to continually improve our CI too.
133 ### Tag moving process
137 From a rebased `main` checkout:
139 1. `git tag -f stable VERSION_TAG`
140 1. e.g. `git tag -f stable 21.5b1`
141 1. `git push --tags -f`