Replies: 1 comment
-
Hello @Lalufu,
Yes.
Yes,
Another possible solution that might come up soon, is a poetry plugin that can build a wheel with pinned version. Than you can pip install this wheel. fin swimmer |
Beta Was this translation helpful? Give feedback.
-
Issue
I have a question regarding dependency resolution in poetry when using
pip install
to install a package that is managed by it. I did not find a clear answer to this in the documentation.My understanding of dependency resolution in poetry is the following:
pyproject.toml
I define my dependencies for development and runtimepoetry add
.poetry install
will take all these dependencies, build the tree, find a solution that satisfies all the different direct and indirect dependency requirements, installs those packages in the versions determined, and writes the chosen version numbers intopoetry.lock
.poetry.lock
should be version controlled, so that multiple people working on the same project get the same versions of dependencies.poetry update
, which will reevaluate the tree and updatepoetry.lock
, if required.So far this is clear to me and makes sense.
However, when a poetry managed package is installed via
pip install
, what seems to happen is that the pip install process runs another dependency resolution process, looking only atpyproject.toml
, and not atpoetry.lock
. This is even thoughbuild-backend = "poetry.core.masonry.api"
is present in thepyproject.toml
file. This might lead topip install
picking different dependency versions thanpoetry install
did. I would expectpip install
with the poetry build backend to look atpoetry.lock
to make sure end users get the exact same dependency versions that the package was developed and tested with.pip install
does not consultpoetry.lock
?Beta Was this translation helpful? Give feedback.
All reactions