-
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 build does not install build dependencies (affects both install and build) #2789
Comments
@mdgoldberg can you give the branch in #2794 a try? |
@abn Yeah that works, thank you! One thing is that it leaves the build dependencies installed after |
The decision to keep them installed was intentional. While, these dependencies are not required for runtime, it is still a development dependency of the package (as in, it is required for the development of the package). Without it, editable installs of the project would not be possible as that ( As for the docker layer size, doubt the addition of these dependencies will blow up the size. If that is really a concern, I'd recommend building a wheel and installing that instead of having poetry manage the installation in the runtime container. Or do |
@abn Yeah, that makes sense. Thanks for your help. When do you think the functionality in that PR will be available on a release accessible via |
No guarantees on that one unfortunately. I'd like to get feedback from the other maintainers regarding the approach I have taken first. It might require rework. |
Sounds good. Definitely looking forward to that update (and 1.1 in general), for now I will just |
Unfortunately, this does not work if you want to publish and distribute your package. A user will need to install build dependencies for your package manually. It is not a good way. For example, I need to publish a library with C++ pybind11 based extension modules. The library is distributed in prebuilt wheels for many platforms. I can add pybind11 to dev dependencies for development and building wheels. But also I want to provide sdist with source code, so that a user can install it from the source. And I don't want to require pybind11 dependency always. Only for installing from the sources. pybind11 is not required for prebuilt wheels. I need to build dependencies here, dev dependencies do not work in this case. |
The PR still isn't in a public release right? I'm still seeing the Cython issue in the latest Poetry |
At least what's working for me is adding cython to tool.poetry.dev-dependencies. That shouldn't be necessary, i don't think, but it's kinda true at least. |
I would like to add that this workaround no longer works in 1.2.0a2. Hopefully the 1.2.x series will address this issue properly! |
It seems like this bandaid to avoid some build-system related overrides causes more problems than it fixes. Let's just deal with reality up-front and hope that python-poetry/poetry#2789 will be fixed at some point.
It seems like this bandaid to avoid some build-system related overrides causes more problems than it fixes. Let's just deal with reality up-front and hope that python-poetry/poetry#2789 will be fixed at some point.
It seems like this bandaid to avoid some build-system related overrides causes more problems than it fixes. Let's just deal with reality up-front and hope that python-poetry/poetry#2789 will be fixed at some point.
It seems like this bandaid to avoid some build-system related overrides causes more problems than it fixes. Let's just deal with reality up-front and hope that python-poetry/poetry#2789 will be fixed at some point.
I've resigned myself to:
|
Still an issue in 1.6.1 |
no it's not, as we can easily verify thanks to the repo with a reproduction provided at the top of this thread |
|
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).Issue
I created a repo with a minimal reproduction: https://github.com/mdgoldberg/poetry-cython-example
The problem here is that Cython isn't installed prior to building/installing the root package, even though Cython is specified in
build-system.requires
in the pyproject.toml. Here's how I am reproducing the issues, for bothpoetry install
andpoetry build
:Note that for the fix, all that matters is whether Cython is installed in the "current" Python environment. If I install Cython globally but then activate the virtual env (which doesn't have Cython), then
poetry install
andpoetry build
still fail. Conversely, if I install Cython in the virtualenv and try topoetry install
orpoetry build
from the directory but outside the virtualenv, it also fails.Please, let me know if I'm misusing
build.py
or any other features, I know some of them may not be stabilized. For now, I'm just installing Cython before runningpoetry build
or poetry install` in my Dockerfile, but it really seems like I shouldn't need to, per PEP 518. Let me know if I'm misunderstanding, and thank you for developing Poetry!The text was updated successfully, but these errors were encountered: