I am not sure about official use, but I use extras_require() to indicate conditional dependencies.
In my case -
extras_require={":python_version<'3.5'": ["scandir"]}
Theoretically, this should be accessible through install_requires() , but it only works the way it should start with the X.XX version (a few statements about which version starts to understand it correctly) setuptools .
This article explains this beautifully: Conditional Python dependencies
source share