You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pybind11.get_include() returns wrong directory when I set pybind11 as build-system:requires in pyproject.toml
pip installs build-system:requires to temporary directory (e.g. /tmp/pip-XXX) only during setup.
(Since setup_requires option uses easy_install and does not install pybind11 header correctly,
pyproject.toml is only solution (as far as I know) for using pybind11 in setup.py without pre-installation.)
…utils`
Install directories are defined at `distutils.command.install`
https://github.com/python/cpython/blob/master/Lib/distutils/command/install.py
Depending on OS type, user site etc., one of the install schemes is selected.
This patch
1. expand parameters (python version etc.) in `INSTALL_SCHEMES`
2. calculates relative path from "purelib" to "headers"
3. checks existence of "header" directory for all schemes one by one
4. returns the include directory if it exists
5 falls back to the original non-installated case when no schemes match
This implementation should work as long as installation
tool (e.g. pip) uses standard `distutils`.
Notice:
step 1 (expansion parameters) cannot be taken out from `distutils`
source and copied by manually, which means `get_include()` will
break when `distutils` changes its implementation.
Issue description
pybind11.get_include()
returns wrong directory when I set pybind11 asbuild-system:requires
in pyproject.tomlpip installs
build-system:requires
to temporary directory (e.g. /tmp/pip-XXX) only during setup.(Since
setup_requires
option uses easy_install and does not install pybind11 header correctly,pyproject.toml is only solution (as far as I know) for using pybind11 in setup.py without pre-installation.)
This issue probably has same origin with #1425
Reproducible example code
pyproject.toml
setup.py
test/test.cc
Then, execute following command
docker run -it --rm -v $(pwd):/test python bash pip install /test
Possible Fix
The installation directories are defined at distutils.command.install (and copied to install_heders etc.)
The following code convert from install module directory to header directory.
It should be fine, as long as installation tool uses standard
distutils
.The text was updated successfully, but these errors were encountered: