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
using virtual environment created with python -m venv .venv.
Description
I am trying to build a binary extension (example2) that uses headers from another binary extension (example1) that has been installed in the virtual environment. pip installs the headers to .venv/include/site/python3.11/example2. Here is the code from pip where this path comes from.
However, setuptools (invoked with python -m build example2 --no-isolation) is only passing -I/Users/david/work/junk/setuptools-test/.venv/include -I/Library/Frameworks/Python.framework/Versions/3.11/include/python3.11 so the headers from example1 are not found and the build fails.
Expected behavior
Setuptools should pass -I/Users/david/work/junk/setuptools-test/.venv/include/site/python3.11 to the compiler instead of (or in addition to?) -I/Users/david/work/junk/setuptools-test/.venv/include.
Hi @dlech, I might be wrong, but I have the impression that this issue has to be first handled in pypa/disutils and then merged into pypa/setuptools. @jaraco might have more information on this.
jaraco
changed the title
[BUG] include directory is incorrect when running in virtual env
headers installed to a virtualenv are omitted from builds
Oct 14, 2023
setuptools version
68.0.0
Python version
CPython 3.11
OS
macOS
Additional environment information
using virtual environment created with
python -m venv .venv
.Description
I am trying to build a binary extension (
example2
) that uses headers from another binary extension (example1
) that has been installed in the virtual environment.pip
installs the headers to.venv/include/site/python3.11/example2
. Here is the code from pip where this path comes from.However,
setuptools
(invoked withpython -m build example2 --no-isolation
) is only passing-I/Users/david/work/junk/setuptools-test/.venv/include -I/Library/Frameworks/Python.framework/Versions/3.11/include/python3.11
so the headers fromexample1
are not found and the build fails.Expected behavior
Setuptools should pass
-I/Users/david/work/junk/setuptools-test/.venv/include/site/python3.11
to the compiler instead of (or in addition to?)-I/Users/david/work/junk/setuptools-test/.venv/include
.How to Reproduce
git clone https://github.com/dlech/setuptools-venv-headers-dir-bug
cd setuptools-venv-headers-dir-bug
python3.11 -m venv .venv
. .venv bin activate
pip install setuptools setuptools-scm wheel build
python -m build example1
pip install example1/dist/example1-0.0.0-cp311-cp311-macosx_10_9_universal2.whl
python -m build example2 --no-isolation
Output
The text was updated successfully, but these errors were encountered: