The problem is that we can't set the dependencies that will be installed by default but will not be installed in case of choosing extras_require.
For example we have mypackage that could work with optional mydependency package. When we run pip install mypackage we want to install mydependency. But when we run pip install mypackage[minimal] we want to install only mypackage.
Current logic of install_requires and extras_require can't do this.
In real world this behavior is required at least by xonsh shell project. When we run pip install xonsh we want to give the best experience to the user by installing all packages and extensions. When we run pip install xonsh[min] we want to install minimal pack of dependencies (this useful for docker containers, testing environments and scripting on xonsh).
Describe the solution you'd like
We can allow to set the special name for the default extra dependencies in the extras_require:
pip install mypackage
# Installation of mypackage, my-required-package, my-package1, my-package2
pip install 'mypackage[min]'
# Installation of mypackage, my-required-package, my-package3
pip install 'mypackage[DEFAULT,min]'
# Installation of mypackage, my-required-package, my-package1, my-package2, my-package3
Alternative Solutions
I tried to set empty name to extras_require i.e. extras_require={'':['my-package1']} but got an error:
pip install mypackage
# ERROR: pip's dependency resolver does not currently take into account all the packages
# that are installed. This behaviour is the source of the following dependency conflicts.
# mypackage 0.0.1 requires my-package1, which is not installed.
For community
⬇️ Please click the 👍 reaction instead of leaving a +1 or 👍 comment
What's the problem this feature will solve?
The problem is that we can't set the dependencies that will be installed by default but will not be installed in case of choosing
extras_require
.For example we have
mypackage
that could work with optionalmydependency
package. When we runpip install mypackage
we want to installmydependency
. But when we runpip install mypackage[minimal]
we want to install onlymypackage
.Current logic of
install_requires
andextras_require
can't do this.In real world this behavior is required at least by xonsh shell project. When we run
pip install xonsh
we want to give the best experience to the user by installing all packages and extensions. When we runpip install xonsh[min]
we want to install minimal pack of dependencies (this useful for docker containers, testing environments and scripting on xonsh).Describe the solution you'd like
We can allow to set the special name for the default extra dependencies in the
extras_require
:In this case we will have this behavior:
Alternative Solutions
I tried to set empty name to
extras_require
i.e.extras_require={'':['my-package1']}
but got an error:For community
⬇️ Please click the 👍 reaction instead of leaving a
+1
or 👍 comment