I'd like to make a Python package that installs a dependency by default unless the user specially signals they do not want that.
Example:
pip install package[no-django]
Does current pip and setup.py mechanism provide way to do this or does not need to have explicit extra_requires
every time?
I don't think this is possible. A way around it is to do a normal extra requires ... where
install_require=[
# ...
# no django listed here
],
extras_require={
'django': ['django'],
}
and install with package[django]
everywhere you need django installed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With