Numba 发布流程

Numba 发布过程的目标——从高层次的角度来看——是发布与给定版本号相对应的源代码和二进制制品。这通常涉及一系列必须按正确顺序并谨慎执行的单个任务。由于 Numba 版本和相应的 llvmlite 版本之间通常存在一对一的映射关系,因此 Numba 和 llvmlite 通常会同步发布。

本节包含各种注释和模板,可用于在Numba Github问题跟踪器上创建Numba发布清单。这是维护者在发布过程中的一种辅助工具,有助于确保所有任务按正确顺序完成,并且不会遗漏任何任务。

如果在发布过程中出现新的或额外的项目,请务必记得将它们添加到检查清单模板中。同时请注意,发布流程本身始终是一个进行中的工作。这意味着这里的一些信息可能已经过时。如果您注意到这一点,请务必记得提交一个拉取请求来更新此文档。

所有发布检查清单都可以作为 Github 问题模板使用。要创建新的发布检查清单,只需打开一个新问题并选择正确的模板。

主要发布候选清单

这是为次要版本的首个/主要发布候选版本,即每个系列的第一个发布。它很特殊,因为在这次发布期间,必须创建发布分支。发布候选版本索引从1开始。

## Numba X.Y.Z

* [ ] Merge to main.
    - [ ] "remaining Pull-Requests from milestone".
* [ ] Check Numba's version support table documentation. Update via PR if
      needed.
* [ ] Review deprecation schedule and notices. Make PRs if need be.
* [ ] Merge change log changes.
    - [ ] "PR with changelog entries".
* [ ] Create X.Y release branch.
* [ ] Create PR against the release branch to make `numba/testing/main.py`
      to refer to `origin/releaseX.Y` instead of `origin/main`.
* [ ] Dependency version pinning on release branch
  * [ ] Pin llvmlite to `0.A.*`.
  * [ ] Pin NumPy if needed
  * [ ] Pin TBB if needed
* [ ] Run the HEAD of the release branch through the build farm and confirm:
  * [ ] Build farm CPU testing has passed.
  * [ ] Build farm CUDA testing has passed.
  * [ ] Build farm wheel testing has passed.
* [ ] Annotated tag `X.Y.Zrc1` on release branch (no `v` prefix).
* [ ] Build and upload conda packages on buildfarm (check "upload").
* [ ] Build wheels and sdist on the buildfarm (check "upload").
* [ ] Verify packages uploaded to Anaconda Cloud and move to `numba/label/main`.
* [ ] Upload wheels and sdist to PyPI (upload from `ci_artifacts`).
* [ ] Verify wheels for all platforms arrived on PyPi.
* [ ] Initialize and verify ReadTheDocs build.
* [ ] Post announcement to discourse group and ping the release testers group
  using `@RC_Testers`.
* [ ] Post link to X and to Mastodon and...

### Post Release:

* [ ] Clean up `ci_artifacts` by moving files to sub-directories
* [ ] Tag `X.Y+1.0dev0` to start new development cycle on `main`.
* [ ] Update llvmlite dependency via PR to `main`, PR includes version updates
      to:
  * [ ] `setup.py`
  * [ ] `numba/__init__.py`
  * [ ] `docs/environment.yml`
  * [ ] `buildscripts/incremental/setup_conda_environment.sh`
  * [ ] `buildscripts/incremental/setup_conda_environment.cmd`
  * [ ] `buildscripts/condarecipe.local/meta.yaml`
* [ ] Update release checklist template with any additional bullet points that
      may have arisen during the release.
* [ ] Close milestone (and then close this release issue).

打开一个主要发布检查清单

后续的候选发布版、最终发布版和补丁发布版

系列中的首次发布之后的版本通常涉及一系列的 cherry-pick,因此其流程略有不同。

## numba X.Y.Z

* [ ] Cherry-pick items from the X.Y.Z milestone into a cherry-pick PR.
* [ ] Update the "version support table" in the documentation with the final
  release date (FINAL ONLY) and add to cherry-pick PR
* [ ] Update `CHANGE_LOG` on cherry-pick PR
* [ ] Check if any dependency pinnings need an update (e.g. NumPy)
* [ ] Approve cherry-pick PR
* [ ] Merge cherry-pick PR to X.Y release branch.
  * [ ] https://github.com/numba/numba/pull/XXXX
* [ ] Review, merge and check execution of release notebook. (FINAL ONLY)
* [ ] Run the HEAD of the release branch through the build farm and confirm:
  * [ ] Build farm CPU testing has passed.
  * [ ] Build farm CUDA testing has passed
  * [ ] Build farm wheel testing has passed
* [ ] Annotated tag X.Y.Z on release branch (no `v` prefix).
  `git tag -am "Version X.Y.Z" X.Y.Z`
* [ ] Build and upload conda packages on buildfarm (check `upload`).
* [ ] Build wheels and sdist on the buildfarm (check "upload").
* [ ] Verify packages uploaded to Anaconda Cloud and move to
  `numba/label/main`.
* [ ] Upload wheels and sdist to PyPI (upload from `ci_artifacts`).
* [ ] Verify wheels for all platforms arrived on PyPi.
* [ ] Verify ReadTheDocs build.
* [ ] Create a release on Github at https://github.com/numba/numba/releases (FINAL ONLY).
* [ ] Post link to X and to Mastodon and...
* [ ] Post announcement to discourse group and ping the release testers group
  using `@RC_Testers` (RC ONLY).
* [ ] Post link to python-announce-list@python.org.

### Post release

* [ ] Cherry-pick change-log and version support table modifications to `main`
* [ ] Snapshot Build Farm config
* [ ] Clean up `ci_artifacts` by moving files to subdirectories
* [ ] Update release checklist template with any additional bullet points that
      may have arisen during the release.
* [ ] Ping Anaconda Distro team to trigger a build for `defaults` (FINAL ONLY).
* [ ] Close milestone (and then close this release issue).

打开后续发布检查清单

生成发布说明

脚本 maint/gitlog2changelog.py 用于生成发布说明。要准备使用它:

  • 安装依赖项:conda install docopt pygithub gitpython

  • 在 Github 上生成一个细粒度的个人访问令牌,具有对公共仓库的读取权限。这可以在 Github 个人访问令牌设置 中完成。

  • 确定变更日志的基础提交。这是 main 分支和上一个发布分支之间的共同提交,可以通过运行 git merge-base main <branch> 来确定。例如,如果为 0.59 版本生成发布说明,branch 可能是 release0.58

然后可以在仓库的根目录下调用脚本:

python maint/gitlog2changelog.py --token="<token>" --beginning="<base commit>" \
                                 --repo="numba/numba" --digits=4

这使用了上面建立的令牌和提交。--digits 参数指定了拉取请求编号中的位数 - 目前是 4 位,但在撰写本文后不久将变为 5 位 - 当这种情况发生时,将需要运行脚本两次,一次使用 --digits=4,一次使用 --digits=5,并将结果合并。

脚本应输出可以粘贴到仓库根目录下 CHANGE_LOG 文件顶部的发布说明。截断的示例输出如下:

Pull-Requests:

* PR `#8990 <https://github.com/numba/numba/pull/8990>`_: Removed extra block copying in InlineWorker (`kc611 <https://github.com/kc611>`_)
* PR `#9048 <https://github.com/numba/numba/pull/9048>`_: Dynamically allocate parfor schedule. (`DrTodd13 <https://github.com/DrTodd13>`_)

<... some output omitted ...>

Authors:

* `apmasell <https://github.com/apmasell>`_
* `DrTodd13 <https://github.com/DrTodd13>`_

<... some output omitted ...>