-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
poetry does not seem to use the virtualenv's include directory when building wheels #8727
Comments
the build happens in a temporary, new, isolated virtual environment - so there is no expectation that this should work (I don't know why it would work with pip, per PEP517 it should be doing the same thing) |
Experimentally it looks like pip does the wheel building in the active virtualenv (the only way the compile could work, since the boost headers are found). I'm not familiar enough with PEP517 to know if that's expected behavior or not; is there any way to have poetry also use the active virtualenv for building like pip does, or to provide it information about additional includes in the pyproject.toml? Poetry can be made to go with something like this: But any additional wheel-building further operations need to be prefixed with that environment variable or they'll fail in the same way. In my case I can't set that environment variable globally because I have debug versions of boost to wrangle as well. Ideally I'd like to tell poetry where boost lives so any virtualenv it creates it would work all the time. |
I don't think that pip is doing the building in the active virtualenv, rather I think that some of the active virtualenv is leaking through to the isolated virtualenv. That is, I think you have been relying on a pip bug. No, poetry has no support for non-isolated builds. I see that turbodbc supports an environment variable |
Thanks for getting back to me. Is there a poetry-only way of telling the isolated venv about additional include directories? In my case I can't set I'd be happy not relying on pip bugs going forward if there's way to do this right 😃 |
poetry doesn't know anything about include directives, or even gcc: this is all happening somewhere deep inside turbodbc's setup.py, and setuptools. It is turbodbc that gets to decide what parameters are passed to what compiler and when, not poetry. |
Thanks for getting back to me again. Understood about turbodbc, I'm asking about the isolated virtualenv that's created by poetry or pip. I think you're right that pip probably copies the cpp Poetry likely creates entirely new ones, and that's why I see missing includes with I'm asking if poetry could be provided a list of directories to populate an isolated virtualenv with in a pyproject.toml setting. Something like declaring "this project should also look for cpp files here" |
I do not think that pip copies the If you add I continue to hold that the poetry build is in the right: in the pip build the "isolated" environment is not well isolated from the original! Front-end responsibility - ie either poetry or pip - is just to set up an isolated environment, and then call the appropriate hooks to execute the build as defined by turbodbc. (In poetry most of this is also offloaded to dependencies rather than being something that poetry implements itself. If I did think that there was a bug here, I would likely be directing you to https://github.com/pypa/build/ anyway). If you want a means to pass non-standard include directories to the turbodbc build - you should talk to turbodbc about that |
You can indeed reproduce this using only that $ pip install build
...
$ tar xvfz turbodbc-4.9.0.tar.gz
...
$ cd turbodbc-4.9.0
$ python -m build in which as expected the include directory is given relative to the temporary isolated environment, rather than the environment that you start in. ie if I have not convinced you and you believe that this include directory ought to refer to the original environment - please take that up at pypa/build |
Thanks for that, I wasn't aware that this only worked with For anyone else running into the issue of how to get poetry to recognize wheel dependencies in non-standard locations, have a look at poetry's dotenv plugin, setting your .env file to contain something like:
|
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
-vvv
option) and have included the output below.Issue
I'm having trouble adding turbodbc to my project with poetry, using
poetry add turbodbc
, and it looks as though the created virtualenv does not look inside it's include directory for headers when building wheels.The background is that I need to use a specific version of boost to be compatible with other portions of my project, so I have that downloaded and built elsewhere in my dev tree, and symlink the boost header directory into
venv/include/boost
to satisfy turbodbc.I can build wheels successfully with
pip wheel --no-cache-dir --use-pep517 "turbodbc (==4.9.0)"
using this virtualenv, and get a properturbodbc-4.9.0-cp310-cp310-linux_x86_64.whl
at the end, and can also successfully 'pip install turbodbc` in one step.While pip works just fine in this setup,
poetry add turbodbc
yields:This error is a bit puzzling, since as mentioned above,
pip wheel --no-cache-dir --use-pep517 "turbodbc (==4.9.0)"
does produce a valid wheel. Looking at the compilation step, I can see that it's passing the compiler-Iinclude/
, but it doesn't seem to get the headers.A clue may be the virtualenv mentioned at
-I/tmp/tmpvdpyiqt9/.venv
, it looks like poetry may be creating a temporary virtualenv to do the build process that does not carry the include directory over.Thanks a lot for your time.
The text was updated successfully, but these errors were encountered: