Extras of a dependency's dependency are not installed
See original GitHub issue- I am on the latest Poetry version.
- I have searched the issues of this repo and believe that this is not a duplicate.
- If an exception occurs when executing a command, I executed it again in debug mode (
-vvv
option).
- OS version and name: Ubuntu 18.04
- Poetry version: 0.12.17 and 1.0.0b5
- Link of a Gist with the contents of your pyproject.toml file: https://github.com/hukkinj1/bug-poetry-dependency-extras/blob/master/pyproject.toml
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 requires requests[security]
. The security extra is not installed though. This can be observed by the fact the the lockfile has no pyOpenSSL
entry, which is a part of the security extra of requests
.
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.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:15
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Recursive Optional Dependencies in Python - Hynek Schlawack
A package's optional dependencies (also known as extras) are named sets of dependencies that are installed by putting their names inside ...
Read more >Installing Python dependencies - AWS Documentation
A Python dependency is any package or distribution that is not included in the Apache Airflow base install for your Apache Airflow version...
Read more >What is 'extra' in pypi dependency? - Stack Overflow
Extras are dependencies you can install in addition to the regular dependencies, if you ask for them explicitly. See them as optional ...
Read more >Install extra ML.NET dependencies - Microsoft Learn
Learn how to install any native libraries that ML.NET packages are dependent on but do not get installed with the NuGet packages.
Read more >Chapter 8. Troubleshooting Dependencies Red Hat Fuse 7.2
There are two basic causes of a missing dependency: either a required feature or bundle is not installed in the container; or your...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@abn updating helped
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.