pip silently fails to install extras and returns error code
See original GitHub issueIt seems that pip just returns success code on anything related to use of extras, commands like: pip install -e .[non_exiting_extra]
reports success.
Even worse, with existing extras that may fail to install, the final result code is still a success, when in fact pip failed to install dependencies.
This is a critical bug because it directly affect CI usage where we can no longer trust result code from pip, bugs may go in unnoticed.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:23 (22 by maintainers)
Top Results From Across the Web
Specify extras_require with pip install -e - Stack Overflow
I know that you can do pip install project[extra] when the project is on pypi. And you have to do pip install -e...
Read more >pip install - pip documentation v22.3.1
A failed install is less likely to leave a broken environment. ... pip looks for packages in a number of places: on PyPI...
Read more >Changelog — Python 3.11.1 documentation
The errno modules exposes the new error number. getpath.py now ignores PermissionError when it ... gh-98940: Fix Mac/Extras.install.py file filter bug.
Read more >pipenv Documentation - Read the Docs
The recommended way to install pipenv on most platforms is to install from pypi ... The command will perform a verification, and return...
Read more >Commands | Documentation | Poetry - Python dependency ...
--all-extras : Install all extra features (conflicts with –extras). --no-dev : Do not install dev dependencies. (Deprecated, use --without dev or --only main ......
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
I don’t know a lot about the tradeoffs but I’ll add one more vote for changing this from a warning to an error. I probably should understand this better, but apparently if any transitive dependency is installed with an invalid extra you won’t be able to load entrypoints from an upstream package. e.g. Lets say package A depends on package B, and B requires
C[invalid_extra]
, package A also has entrypoint"my_group": "my_extra=A.foo.Bar"
Runningwill give
This is a bug in package B, but it would be easy for it to slip through their CI unless someone happened to know this behavior (which is unexpected to me). Having
pip
error out on missing extras would make this easier to catch.Not fully ignore - I believe we trace a warning.
Returning non-zero would be backwards incompatible. I would be +1 on doing it (even aborting installation if we are not able to find an extra), but it would need to be changed over at least 1-2 releases. The first step would be to add to the existing warning to say that it’s unsupported and will fail in a future release. We’d also want to go through pypi and see how many packages make reference to nonexistent extras.