-
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
Resolver fails to keep 2nd level dependencies that use optional packages when performing "update" #2545
Comments
This issue affected me as well! If my project depends on A, which depends on B[plus_some_extras] and I add B as a dependency for my project, we no longer install the needed extras. Note in the following that
|
I'm hitting this in a very similar situation to @hauntsaninja , also with My case is, adding If I then add For what it's worth both packages have To reproduce:
This is with: poetry==1.0.9 |
Could @sdispater or @finswimmer drop by to confirm this is acknowledged and will be worked on? It's a major bug that affects dependency resolution and which packages are installed, and one that has been apparently present for quite some time. |
I can confirm that this happens to me as well when doing |
I can also confirm that and I agree this is a major issue. |
This bug is still present in poetry version |
Could be a duplicate of #1609 |
@abn good catch, I missed this one when searching for similar issues. Strange that the resolution happens correctly on the first EDIT: From my limited knowledge of the source, I could find this condition poetry/poetry/installation/installer.py Line 181 in bce954a
that is different in case of first install vs. update statement. There is a "locked repository" and a whitelist that are generated, only when the update command is run. Unfortunately I can't understand the implications at the moment. I could imagine that the packages required by the 2nd-level "extra" are not added to that "locked repository" or whitelist, and thus are not included in the lockfile upon update .
|
We are affected by this as well. |
We've also been affected by this. Loss of time + now having to circumvent the issue. |
Thank you for fixing this! Looking at those PRs, I'm glad I gave up on trying to fix this myself :-) |
Thanks from my side too! Looking forward to the release that includes these fixes |
Hey @sdispater, is the fix you implemented present in poetry $ poetry new test_proj
$ cd test_proj
$ poetry install
$ poetry add tsfresh # dask[dataframe] is required, fsspec is required by dask[dataframe]
# fsspec was not installed, but it should
$ poetry run python -c 'from dask import dataframe' # fails with ImportError: fsspec is required... So I would say it's a step backwards Verbose logs
|
@vbersier Can you please try the fix at #3147. Using pipxpipx install --suffix=@3147 'poetry @ git+https://github.com/python-poetry/poetry.git@refs/pull/3147/head' Using a container (podman | docker)podman run --rm -i --entrypoint bash python:3.8 <<EOF
set -e
python -m pip install -q git+https://github.com/python-poetry/poetry.git@refs/pull/3147/head
python -m poetry new foobar
pushd foobar
sed -i /pytest/d pyproject.toml
python -m poetry add tsfresh
python -m poetry run python -c 'from dask import dataframe'
EOF |
Hey @abn , Thanks for the suggestion, indeed this PR fixes the problem! Nice 👍 |
This also fixes my very weird 2nd level dependencies error. Thanks, hope it gets released soon, wasted a night trying to debug it :( |
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. |
I am on the latest Poetry version.
I have searched the issues of this repo and believe that this is not a duplicate (see comment below with possible linked issues).
If an exception occurs when executing a command, I executed it again in debug mode (
-vvv
option).OS version and name: macOS 10.15.5
Poetry version:
1.0.9
,1.0.10
,1.1.0b2
Link of a Gist with the contents of your pyproject.toml file: See commands below
Issue
There is an inconsistency between the
install
andupdate
commands when it comes to resolving dependencies of packages that require themselves a package with extras.Consider the following minimal example:
tsfresh
depends ondask[dataframe]
dask[dataframe]
depends onfsspec
andpartd
I must say that I found old issues that seem to be similar but since this is a very critical bug, I chose to open a new issue for visibility anyway. Also, it seems mine is more general than these:
#2300
#2494
#2080
Here are the logs of both commands:
install
update
The text was updated successfully, but these errors were encountered: