-
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 ignores dependencies of dependencies which are "ambient" (installed in current venv, but not fetched by poetry) #9774
Comments
Please provide a way to reproduce. The |
I pushed a reproducer at https://github.com/ggirol-rc/poetry_repro you can reproduce as:
My output for this procedure
Package operations: 4 installs, 0 updates, 0 removals
Writing lock file Installing the current project: lib (0.1.0)
Package operations: 2 installs, 2 updates, 0 removals
Writing lock file Installing the current project: app (0.1.0)
|
Since you do not declare Perhaps there is some mix up with https://pypi.org/project/lib/, though since that project does not have a version 0.1.0 that also does not make sense. I am not at a computer to check but I suspect that your repro will not give the behaviour you are reporting. You may need to clear your cache. |
I pushed to the reproduction repo a commit that renames the projects so that they have names which are actually not taken in pypi, my bad. About clearing cache, I can reproduce inside a brand new docker container:
so I doubt the problem is related to cache. This also makes me quite confident that you will be able to reproduce when you are at a computer. |
I will not be at a computer for some time: but I continue to fail to understand how the app can succeed in locking. The app does not declare a dependency on a local library, it declares a dependency on a non-existent project, and poetry should say so. You will want to investigate what is in the lock file, what |
Here are the parts of
Full poetry.lock# This file is automatically @generated by Poetry 1.8.4 and should not be changed by hand. |
this is basically duplicate #8328 probably the lines of code identified in that issue should just be removed pull request welcome, I expect |
Description
Consider a project consisting of a python package
lib
and an applicationapp
depending onlib
by version number. Neitherapp
norlib
can be downloaded from any repository, they only exist locally.If
app
andlib
have conflicting requirements,poetry
will ignore the requirements oflib
.Steps to reproduce:
1/ create an ambient virtualenv
2/ configure
lib
to depend on an old version ofpydantic
3/ install
lib
into the venv:4/ configure
app
to depend onlib==0.1.0
and a version ofpydantic-settings
requiring a too recent version ofpydantic
5/ resolve dependencies:
and install it:
Observed behavior:
running
poetry install
inapp
upgrades pydantic to a version compatible with its dependency topydantic-settings
but breaks the transitive dependencylib>pydantic==2.0
running
poetry install
inlib
similarly downgrades pydantic, breaking pydantic settingsNotice in the output of
poetry lock -vv
inapp
above, how poetry detects the presence oflib
but does not mention dependencies oflib
at all.Expected behavior:
poetry should report this error when called in
app
:Workarounds
In
app/pyproject.toml
, uselib = { path = "..." }
instead oflib = "0.1.0"
. This is not compatible with installinglib
from a non-constant path nor from a wheel.Poetry Installation Method
pip
Operating System
Ubuntu 20.04
Poetry Version
Poetry (version 1.8.4)
Poetry Configuration
Python Sysconfig
Example pyproject.toml
See above
Poetry Runtime Logs
The text was updated successfully, but these errors were encountered: