1
1
On version numbers
2
2
^^^^^^^^^^^^^^^^^^
3
3
4
- The two version numbers (C++ and Python) must match when combined (checked when
5
- you build the PyPI package), and must be a valid `PEP 440
6
- <https://www.python.org/dev/peps/pep-0440> `_ version when combined.
4
+ The version number must be a valid `PEP 440
5
+ <https://www.python.org/dev/peps/pep-0440> `_ version number.
7
6
8
7
For example:
9
8
10
9
.. code-block :: C++
11
10
12
11
#define PYBIND11_VERSION_MAJOR X
13
12
#define PYBIND11_VERSION_MINOR Y
14
- #define PYBIND11_VERSION_PATCH Z.dev1
13
+ #define PYBIND11_VERSION_PATCH Za0
15
14
16
- For beta, ``PYBIND11_VERSION_PATCH `` should be ``Z.b1 ``. RC's can be ``Z.rc1 ``.
17
- Always include the dot (even though PEP 440 allows it to be dropped). For a
18
- final release, this must be a simple integer. There is also
15
+ For beta, ``PYBIND11_VERSION_PATCH `` should be ``Zb1 ``. RC's can be ``Zrc1 ``.
16
+ For a final release, this must be a simple integer. There is also
19
17
``PYBIND11_VERSION_HEX `` just below that needs to be updated.
20
18
21
19
22
20
To release a new version of pybind11:
23
21
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
24
22
25
23
If you don't have nox, you should either use ``pipx run nox `` instead, or use
26
- ``pipx install nox `` or ``brew install nox `` (Unix).
24
+ ``uv tool install nox ``, `` pipx install nox ``, or ``brew install nox `` (Unix).
27
25
28
26
- Update the version number
29
27
@@ -32,11 +30,9 @@ If you don't have nox, you should either use ``pipx run nox`` instead, or use
32
30
33
31
- Update ``PYBIND11_VERSION_HEX `` just below as well.
34
32
35
- - Update ``pybind11/_version.py `` (match above).
36
-
37
33
- Run ``nox -s tests_packaging `` to ensure this was done correctly.
38
34
39
- - Ensure that all the information in ``setup.cfg `` is up-to-date, like
35
+ - Ensure that all the information in ``pyproject.toml `` is up-to-date, like
40
36
supported Python versions.
41
37
42
38
- Add release date in ``docs/changelog.md `` and integrate the output of
@@ -63,7 +59,7 @@ If you don't have nox, you should either use ``pipx run nox`` instead, or use
63
59
64
60
- ``git tag -a vX.Y.Z -m 'vX.Y.Z release' ``
65
61
66
- - ``grep ^__version__ pybind11/_version.py ``
62
+ - ``git grep PYBIND11_VERSION include/ pybind11/detail/common.h ``
67
63
68
64
- Last-minute consistency check: same as tag?
69
65
@@ -90,9 +86,9 @@ If you don't have nox, you should either use ``pipx run nox`` instead, or use
90
86
click "Draft a new release" on the far right, fill in the tag name
91
87
(if you didn't tag above, it will be made here), fill in a release name
92
88
like "Version X.Y.Z", and copy-and-paste the markdown-formatted (!) changelog
93
- into the description. You can remove line breaks and strip links to PRs and
94
- issues, e.g. to a bare ``#1234 `` without the hyperlink markup. Check
95
- "pre-release" if this is a beta/RC.
89
+ into the description. You can remove line breaks and optionally strip links
90
+ to PRs and issues, e.g. to a bare ``#1234 `` without the hyperlink markup.
91
+ Check "pre-release" if this is an alpha/ beta/RC.
96
92
97
93
- CLI method: with ``gh `` installed, run ``gh release create vX.Y.Z -t "Version X.Y.Z" ``
98
94
If this is a pre-release, add ``-p ``.
@@ -102,7 +98,7 @@ If you don't have nox, you should either use ``pipx run nox`` instead, or use
102
98
- Make sure you are on master, not somewhere else: ``git checkout master ``
103
99
104
100
- Update version macros in ``include/pybind11/detail/common.h `` (set PATCH to
105
- ``0.dev1 `` and increment MINOR).
101
+ ``0a0 `` and increment MINOR).
106
102
107
103
- Update ``pybind11/_version.py `` to match.
108
104
@@ -113,16 +109,10 @@ If you don't have nox, you should either use ``pipx run nox`` instead, or use
113
109
114
110
- ``git add ``, ``git commit ``, ``git push ``
115
111
116
- If a version branch is updated, remember to set PATCH to ``1.dev1 ``.
117
-
118
- If you'd like to bump homebrew, run:
119
-
120
- .. code-block :: console
121
-
122
- brew bump-formula-pr --url https://github.com/pybind/pybind11/archive/vX.Y.Z.tar.gz
112
+ If a version branch is updated, remember to set PATCH to ``1a0 ``.
123
113
124
114
Conda-forge should automatically make a PR in a few hours, and automatically
125
- merge it if there are no issues.
115
+ merge it if there are no issues. Homebrew should be automatic, too.
126
116
127
117
128
118
Manual packaging
@@ -137,6 +127,7 @@ this is the procedure:
137
127
.. code-block :: bash
138
128
139
129
nox -s build
130
+ nox -s build_global
140
131
twine upload dist/*
141
132
142
133
This makes SDists and wheels, and the final line uploads them.
0 commit comments