-
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
Extras of a dependency's dependency are not installed #1609
Extras of a dependency's dependency are not installed #1609
Comments
This is a tricky one. I can definitely reproduce and I know why that happens but actually fixing this is not trivial. Unfortunately, it's unlikely that it will be fixed before the For the time being, a workaround is to declare your dependency on requests = {"version": "*", extras = ["security"]} |
Thanks @sdispater for having a look. There is a case where not even the workaround works. I'm not sure how related this is, maybe I should file another bug report for this...? Anyways I'll try to briefly explain it here: Let's imagine a world where the
Running
Following The obvious workaround for this is to require the packages of the P.S. Thanks for poetry! Despite these issues it's still an amazing tool. |
The only way we can solve the extras issues currently is by always resolving the extra dependencies even though they were not opted in. That would fix the issue but it might introduce another which is that resolution conflict might be raised by extra dependencies even though they were never opted in. I don't see a perfect solution for this at the moment. The Python ecosystem is so unique and complex (some might say convoluted) that coming up with a perfect dependency resolver is almost impossible and will sometimes require the help of the end user by hinting it on how it should proceed. |
@sdispater I haven't looked at how the code works, but do you really need to resolve all extras to fix this? It seems like you can keep a list of required extras when resolving a dependency, and if that dependency is required again by some other path you don't skip it or resolve it again from scratch, but just check if there are new extras and only resolve them. You may need to keep a list of required extras for each package to append to whenever you resolve an extra, and you may need some work on how you resolve a dependency in order to be able to do more work on it afterwards (i.e. resolve more extras), but seems doable. Another (maybe simpler) alternative, is to consider |
Having this problem when installing a google lib that does not require the grpcio-gcp extra on google-api-core (e.g. google-cloud-bigtable), then installing one that does (e.g. google-cloud-spanner). The grpcio-gcp extra does not get added unless the adds are done with the one requiring grpcio-gcp first. |
Still relevant to me.
google-cloud-bigquery is installed. pandas is not. |
@mvoitko can you please try |
@abn updating helped |
updating to I still see extras of dependency in |
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
Poetry does not install extras of a dependency's dependency, if the dependency's dependency is also referenced without the extra.
Here's the pyproject.toml. The generated poetry.lock lockfile is here.
Pyproject.toml requires
PyOTA
package, which requiresrequests[security]
. The security extra is not installed though. This can be observed by the fact the the lockfile has nopyOpenSSL
entry, which is a part of the security extra ofrequests
.Note that we remove
requests = "*"
from pyproject.toml, then the security extra will be installed as expected. It seems the issue only occurs when the package that needs extras is referenced elsewhere with no mention of the extras.The text was updated successfully, but these errors were encountered: