doc/HOWTO_RELEASE.rst
These instructions give an overview of what is necessary to build binary releases for NumPy.
Useful info can be found in building-from-source in the docs as well as in
these three files:
HOWTO_RELEASE.rst <https://github.com/numpy/numpy/blob/main/doc/HOWTO_RELEASE.rst>_RELEASE_WALKTHROUGH.rst <https://github.com/numpy/numpy/blob/main/doc/RELEASE_WALKTHROUGH.rst>_BRANCH_WALKTHROUGH.rst <https://github.com/numpy/numpy/blob/main/doc/BRANCH_WALKTHROUGH.rst>_:ref:NEP 29 <NEP29> outlines which Python versions are supported at a
minimum. We usually decide to keep support for a given Python version slightly
longer than that minimum, to avoid giving other projects issues - this is at
the discretion of the release manager.
macOS
We aim to support the same set of macOS versions as are supported by
Python.org and cibuildwheel_ for any given Python version.
We build binary wheels for macOS that are compatible with common Python
installation methods, e.g., from python.org, python-build-standalone (the
ones uv installs), system Python, conda-forge, Homebrew and MacPorts.
Windows
We build 32- and 64-bit wheels on Windows. Windows 7, 8 and 10 are supported.
We build NumPy using the most convenient compilers, which are (as of Aug
2025) MSVC for x86/x86-64 and Clang-cl for arm64, cibuildwheel_ and GitHub
Actions.
.. _cibuildwheel: https://cibuildwheel.readthedocs.io/en/stable/
Linux
We build and ship manylinux and musllinux wheels for x86-64 and
aarch64 platforms on PyPI. Wheels for 32-bit platforms are not currently
provided. We aim to support the lowest non-EOL versions, and upgrade roughly
in sync with cibuildwheel_. See
pypa/manylinux <https://github.com/pypa/manylinux>__ and
this distro compatibility table <https://github.com/mayeut/pep600_compliance?tab=readme-ov-file#distro-compatibility>__
for more details.
BSD / Solaris / AIX
No binary wheels are provided on PyPI, however we expect building from source on these platforms to work fine.
For building wheels, we use the following toolchains:
manylinux/musllinux Docker
images, which is usually a relatively recent GCC version.libnpymath library for SciPy - please
inspect the numpy/numpy-release <https://github.com/numpy/numpy-release>__
code and CI logs in case the exact version numbers need to be determined.For building from source, minimum compiler versions are tracked in the top-level
meson.build file.
Most wheels link to a version of OpenBLAS_ supplied via the openblas-libs_ repo. The shared object (or DLL) is shipped within the wheel, renamed to prevent name collisions with other OpenBLAS shared objects that may exist in the filesystem.
.. _OpenBLAS: https://github.com/OpenMathLib/OpenBLAS .. _openblas-libs: https://github.com/MacPython/openblas-libs
We are no longer building pdf files. The requirements for building the
html docs are no different than for regular development. See the README of
the numpy/doc <https://github.com/numpy/doc>__ repository and the step by
step instructions in doc/RELEASE_WALKTHROUGH.rst for more details.
Creating a release on PyPI and uploading wheels and sdist is automated in CI
and uses PyPI's trusted publishing <https://docs.pypi.org/trusted-publishers/>.
See the README in the numpy/numpy-release <https://github.com/numpy/numpy-release>
repository and the step by step instructions in doc/RELEASE_WALKTHROUGH.rst
for more details.
You will need a personal access token
<https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/>_
so that scripts can access the GitHub NumPy repository. With that token, the
author/PR changelog content can be generated by running spin changelog. It
may require a few extra packages, like gitpython and pygithub.
On PyPI we release wheels for a number of platforms (as discussed higher up), and an sdist.
On GitHub Releases we release the same sdist (because the source archives which are autogenerated by GitHub itself aren't complete), as well as the release notes and changelog.
A typical release schedule for a feature release is two release candidates and
a final release. It's best to discuss the timing on the mailing list first, in
order for people to get their commits in on time. After a date is set, create a
new maintenance/x.y.z branch, add new empty release notes for the next version
in the main branch and update the Milestones on the issue tracker.
Before :ref:the release branch is made <branching>, it should be checked that
all deprecated code that should be removed is actually removed, and all new
deprecations say in the docstring or deprecation warning what version the code
will be removed.
The C API version needs to be tracked in three places
There are three steps to the process.
If the API has changed, increment the C_API_VERSION in numpy/core/meson.build. The API is unchanged only if any code compiled against the current API will be backward compatible with the last released NumPy version. Any changes to C structures or additions to the public interface will make the new API not backward compatible.
If the C_API_VERSION in the first step has changed, or if the hash of the API has changed, the cversions.txt file needs to be updated. To check the hash, run the script numpy/_core/cversions.py and note the API hash that is printed. If that hash does not match the last hash in numpy/_core/code_generators/cversions.txt the hash has changed. Using both the appropriate C_API_VERSION and hash, add a new entry to cversions.txt. If the API version was not changed, but the hash differs, you will need to comment out the previous entry for that API version. For instance, in NumPy 1.9 annotations were added, which changed the hash, but the API was the same as in 1.8. The hash serves as a check for API changes, but it is not definitive.
If steps 1 and 2 are done correctly, compiling the release should not give a warning "API mismatch detect at the beginning of the build".
The numpy/_core/include/numpy/numpyconfig.h will need a new NPY_X_Y_API_VERSION macro, where X and Y are the major and minor version numbers of the release. The value given to that macro only needs to be increased from the previous version if some of the functions or macros in the include files were deprecated.
The C ABI version number in numpy/_core/meson.build should only be updated for a major release.
Use towncrier_ to build the release note and
commit the changes. This will remove all the fragments from
doc/release/upcoming_changes and add doc/release/<version>-note.rst.::
towncrier build --version "<version>"
git commit -m"Create release note"
Check that the release notes are up-to-date.
Update the release notes with a Highlights section. Mention some of the following:
.. _towncrier: https://pypi.org/project/towncrier/