Declaring extras in constraints file installs also extra dependencies even if not instructed to
See original GitHub issueEnvironment
- pip version:
19.1.1
- Python version:
3.7.2
- OS:
KDE Neon
Description
In constraints file, when declaring a package with extras, all the dependencies of it get installed, even if actual requirement does not declare extras.
How to Reproduce
echo "requests[security]==2.20.1" > constraints.txt
pip install -c constraints.txt requests
Output
This installs not only direct requests
dependencies:
Installing collected packages: chardet, certifi, idna, urllib3, requests
But also [security]
extras:
Installing collected packages: idna, chardet, certifi, urllib3, six, pycparser, cffi, asn1crypto, cryptography, pyOpenSSL, requests
Expected behavior
pip should install only direct dependencies, even if extras are declared in constraints file.
This is such a simple case and easy to reproduce, it must be expected behavior. But why? And where is it documented?
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Dependency constraints for setuptools? - Packaging
I was wondering if it would be possible (and desirable…) to implement something similar for setuptools . What I have in mind is...
Read more >Installation from PyPI - Apache Airflow
In order to simplify the installation, we have prepared examples of how to upgrade Airflow and providers. Installing Airflow with extras and providers¶....
Read more >User Guide - pip documentation v22.3.1
Constraints files are requirements files that only control which version of a requirement is installed, not whether it is installed or not.
Read more >Announcing Poetry 1.2.0 | Blog
As Poetry 1.1 will remove optional dependencies that are not requested, and as it considers setuptools, pip, and wheel to always be optional, ......
Read more >python - requirements.txt vs setup.py - Stack Overflow
This is a python script which uses the setuptools module to define a python package (name, files included, package metadata, and installation). It...
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
OK to close, given that we don’t allow this form with the new resolver.
Closing since #8491 is merged and there’s not much else to do here.