A python library has two packages “package1” and “package2”. Both packages support optional extras “extras”. Package1 has a setup.cfg as follows:
[options]
install_requires = package2
[options.extras_require]
extras = package2[extras]
and package2 has setup.cfg has:
[options.extras_require]
extras = extra_package
The idea being that if package1 is install via pip install package1[extras]
then the dependent package2 will also pull in its extras – namely “extra_package”.
However cascaded “extras” dependencies of package2 are NOT pulled in and extra_package is missing from the environment.
How to achieve the cascading of an extras so that both “extras” of package1 and package2 are pulled in with single pip install of the top package?