Skip to content

Commit 8d503e3

Browse files
authored
docs: update contributing/release guide a little (#5681)
Signed-off-by: Henry Schreiner <[email protected]>
1 parent 2624d4a commit 8d503e3

File tree

2 files changed

+28
-26
lines changed

2 files changed

+28
-26
lines changed

.github/CONTRIBUTING.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,21 @@ build only one of the valid targets (listed below).
117117
```bash
118118
cmake --preset venv -DPYBIND11_CREATE_WITH_UV=3.13t
119119
cmake --build --preset venv
120-
cmake --build --preset testsvenv -t cpptest
120+
cmake --build --preset venv -t cpptest
121121
```
122122

123-
The `default` preset will use an existing venv or Python install.
123+
The `default` preset will use an existing venv or Python install. If you'd like
124+
to run pytest yourself, say to easily control the options:
125+
126+
```bash
127+
cd build
128+
source .venv/bin/activate
129+
cd tests
130+
python -m pytest
131+
```
132+
133+
The `.so` file is not installed into the venv, so you need to run from this
134+
directory, the local directory is included with `python -m`.
124135

125136
## Configuration options
126137

docs/release.rst

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,27 @@
11
On version numbers
22
^^^^^^^^^^^^^^^^^^
33

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.
76

87
For example:
98

109
.. code-block:: C++
1110

1211
#define PYBIND11_VERSION_MAJOR X
1312
#define PYBIND11_VERSION_MINOR Y
14-
#define PYBIND11_VERSION_PATCH Z.dev1
13+
#define PYBIND11_VERSION_PATCH Za0
1514

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
1917
``PYBIND11_VERSION_HEX`` just below that needs to be updated.
2018

2119

2220
To release a new version of pybind11:
2321
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2422

2523
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).
2725

2826
- Update the version number
2927

@@ -32,11 +30,9 @@ If you don't have nox, you should either use ``pipx run nox`` instead, or use
3230

3331
- Update ``PYBIND11_VERSION_HEX`` just below as well.
3432

35-
- Update ``pybind11/_version.py`` (match above).
36-
3733
- Run ``nox -s tests_packaging`` to ensure this was done correctly.
3834

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
4036
supported Python versions.
4137

4238
- 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
6359

6460
- ``git tag -a vX.Y.Z -m 'vX.Y.Z release'``
6561

66-
- ``grep ^__version__ pybind11/_version.py``
62+
- ``git grep PYBIND11_VERSION include/pybind11/detail/common.h``
6763

6864
- Last-minute consistency check: same as tag?
6965

@@ -90,9 +86,9 @@ If you don't have nox, you should either use ``pipx run nox`` instead, or use
9086
click "Draft a new release" on the far right, fill in the tag name
9187
(if you didn't tag above, it will be made here), fill in a release name
9288
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.
9692

9793
- CLI method: with ``gh`` installed, run ``gh release create vX.Y.Z -t "Version X.Y.Z"``
9894
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
10298
- Make sure you are on master, not somewhere else: ``git checkout master``
10399

104100
- Update version macros in ``include/pybind11/detail/common.h`` (set PATCH to
105-
``0.dev1`` and increment MINOR).
101+
``0a0`` and increment MINOR).
106102

107103
- Update ``pybind11/_version.py`` to match.
108104

@@ -113,16 +109,10 @@ If you don't have nox, you should either use ``pipx run nox`` instead, or use
113109

114110
- ``git add``, ``git commit``, ``git push``
115111

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``.
123113

124114
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.
126116

127117

128118
Manual packaging
@@ -137,6 +127,7 @@ this is the procedure:
137127
.. code-block:: bash
138128
139129
nox -s build
130+
nox -s build_global
140131
twine upload dist/*
141132
142133
This makes SDists and wheels, and the final line uploads them.

0 commit comments

Comments
 (0)