[Distutils] Need for ability to limit dependencies similar to 'extras'

P.J. Eby pje at telecommunity.com
Fri Sep 3 18:09:37 CEST 2010

At 04:53 AM 9/1/2010 -0700, Jason R. Coombs wrote:
>We're using setuptools for packaging our Python projects. Several of our
>projects have a server/client aspect to them, where the server is a
>full-fledged service with a lot of dependencies and the client is just an API
>for accessing the server, probably with just a few dependencies.  We want a
>way to install the package with or without these dependencies. With the
>current implementation of setuptools, I believe we have two choices.
>1) Refactor the package into three packages: project_server, project_client,
>and project_common. Project_server would then contain the additional
>2) Use the extras_require for the server facet of the project. So
>"easy_install project" installs the common dependencies and "easy_install
>project[server]" installs the additional dependencies.
>The second option is what we're using, but the [server] facet is the most
>common usage. We would prefer instead to have a way to "easy_install
>project[client]" which would _limit_ the dependencies needed, and
>"easy_install project" would install the full set of dependencies.
>Has anyone heard of a plugin which does this? Is it even possible that a
>plugin could trim out dependencies?

No, and no.  A feature like this would have to be added to 
setuptools, and even then, existing setuptools installations would 
not know how to actually use the feature.  In other words, even if 
this were added, you would have the problem that, even many years 
from now, there would still be users whose setuptools installation 
wouldn't understand how to handle your special setup.

The most practical solution is to either go to option #1, or continue 
to require explicitly specifying [client], [server] or [client,server]

More information about the Distutils-SIG mailing list