Adding a default extra_require environment

Sorry to bump an old thread but I can provide a use case.

I currently have package which provides a collection of ABCs and a number of implementations for each. Each of implementation comes with its own dependencies. I now want to break out each implementation into its own extra because I have users that can’t install some of the implementations, but need access to other parts of the library. So I would like to rewrite my setup.py to have extra implementation specified as an extra:

reqs = ['package1', ...]
a_reqs = [...]
b_reqs = [...]
c_reqs = [...] 

setup(
    ...
    instal_requires = reqs,
    extras_requires = dict(
        A=a_reqs,
        B=b_reqs,
        C=c_reqs,
        ALL=a_reqs + b_reqs + c_reqs
    ),
)

But this would break many downstream users install scripts as they expect package[ALL]. This would not be a problem with a
default_extras_requires (or as I prefer the shed default_requires):

setup(
    ...
    instal_requires = reqs,
    default_requires = a_reqs + b_reqs + c_reqs,
    extras_requires = dict(
        ...,
        MIN=[],
    ),
)
1 Like