release.rst 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. On version numbers
  2. ^^^^^^^^^^^^^^^^^^
  3. The two version numbers (C++ and Python) must match when combined (checked when
  4. you build the PyPI package), and must be a valid `PEP 440
  5. <https://www.python.org/dev/peps/pep-0440>`_ version when combined.
  6. For example:
  7. .. code-block:: C++
  8. #define PYBIND11_VERSION_MAJOR X
  9. #define PYBIND11_VERSION_MINOR Y
  10. #define PYBIND11_VERSION_PATCH Z.dev1
  11. For beta, ``PYBIND11_VERSION_PATCH`` should be ``Z.b1``. RC's can be ``Z.rc1``.
  12. Always include the dot (even though PEP 440 allows it to be dropped). For a
  13. final release, this must be a simple integer.
  14. To release a new version of pybind11:
  15. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  16. - Update the version number
  17. - Update ``PYBIND11_VERSION_MAJOR`` etc. in
  18. ``include/pybind11/detail/common.h``. PATCH should be a simple integer.
  19. - Update ``pybind11/_version.py`` (match above)
  20. - Ensure that all the information in ``setup.cfg`` is up-to-date, like
  21. supported Python versions.
  22. - Add release date in ``docs/changelog.rst``.
  23. - Check to make sure
  24. `needs-changelog <https://github.com/pybind/pybind11/pulls?q=is%3Apr+is%3Aclosed+label%3A%22needs+changelog%22>`_
  25. issues are entered in the changelog (clear the label when done).
  26. - ``git add`` and ``git commit``, ``git push``. **Ensure CI passes**. (If it
  27. fails due to a known flake issue, either ignore or restart CI.)
  28. - Add a release branch if this is a new minor version, or update the existing release branch if it is a patch version
  29. - New branch: ``git checkout -b vX.Y``, ``git push -u origin vX.Y``
  30. - Update branch: ``git checkout vX.Y``, ``git merge <release branch>``, ``git push``
  31. - Update tags (optional; if you skip this, the GitHub release makes a
  32. non-annotated tag for you)
  33. - ``git tag -a vX.Y.Z -m 'vX.Y.Z release'``.
  34. - ``git push --tags``.
  35. - Update stable
  36. - ``git checkout stable``
  37. - ``git merge master``
  38. - ``git push``
  39. - Make a GitHub release (this shows up in the UI, sends new release
  40. notifications to users watching releases, and also uploads PyPI packages).
  41. (Note: if you do not use an existing tag, this creates a new lightweight tag
  42. for you, so you could skip the above step).
  43. - GUI method: click "Create a new release" on the far right, fill in the tag
  44. name (if you didn't tag above, it will be made here), fill in a release
  45. name like "Version X.Y.Z", and optionally copy-and-paste the changelog into
  46. the description (processed as markdown by Pandoc). Check "pre-release" if
  47. this is a beta/RC. You can get partway there with
  48. ``cat docs/changelog.rst | pandsoc -f rst -t markdown``.
  49. - CLI method: with ``gh`` installed, run ``gh release create vX.Y.Z -t "Version X.Y.Z"``
  50. If this is a pre-release, add ``-p``.
  51. - Get back to work
  52. - Make sure you are on master, not somewhere else: ``git checkout master``
  53. - Update version macros in ``include/pybind11/detail/common.h`` (set PATCH to
  54. ``0.dev1`` and increment MINOR).
  55. - Update ``_version.py`` to match
  56. - Add a spot for in-development updates in ``docs/changelog.rst``.
  57. - ``git add``, ``git commit``, ``git push``
  58. If a version branch is updated, remember to set PATCH to ``1.dev1``.
  59. If you'd like to bump homebrew, run:
  60. .. code-block::
  61. brew bump-formula-pr --url https://github.com/pybind/pybind11/archive/vX.Y.Z.tar.gz
  62. Conda-forge should automatically make a PR in a few hours, and automatically
  63. merge it if there are no issues.
  64. Manual packaging
  65. ^^^^^^^^^^^^^^^^
  66. If you need to manually upload releases, you can download the releases from the job artifacts and upload them with twine. You can also make the files locally (not recommended in general, as your local directory is more likely to be "dirty" and SDists love picking up random unrelated/hidden files); this is the procedure:
  67. .. code-block:: bash
  68. python3 -m pip install build
  69. python3 -m build
  70. PYBIND11_SDIST_GLOBAL=1 python3 -m build
  71. twine upload dist/*
  72. This makes SDists and wheels, and the final line uploads them.