pybind11
pybind11 copied to clipboard
fix docs build command on different global and venv python versions
Description
The build command in the docs fails when using a python venv with a different version to the global installation as python3-config will use the global one.
For example on a machine with global python 3.12 in a venv using python 3.11:
(venv) $ python3-config --extension-suffix # .cpython-311-x86_64-linux-gnu.so
(venv) $ python3 -c 'import sysconfig; print(sysconfig.get_config_var("EXT_SUFFIX"))' # .cpython-312-x86_64-linux-gnu.so
This silently causes a 'ModuleNotFound' error as the venv cannot import the generated pybind module.
Suggested changelog entry:
I wonder if we should just bite the bullet and provide a --extension-suffix flag on pybind11-config?
I wonder if we should just bite the bullet and provide a
--extension-suffixflag onpybind11-config?
Sounds good to me.