[Distutils] Having a "less complete" configuration for a project

Paul Moore p.f.moore at gmail.com
Sun Oct 12 13:38:26 CEST 2014

I'm building a project that allows users to create files and directory
structures from static data. The core of the project will be a command
line API that includes a number of features that depend on 3rd party
libraries. But I can see the core of the project being useful for
smaller tasks, for example generating test data. So what I'd like is
to have the "standard" installation "pip install myproj" build the
full application, but have a way to specify (for example in a tox
config) that only the core library, without the larger dependencies,
be installed.

Doing this the other way round is easy using extras:

    pip install myproj  ->  installs myproj and core dependencies
    pip install myproj[cmdline]  -> installs the above, plus jinja2, click, ...

But the problem with this approach is that "normal users" need to know
to specify the extra.

Is it possible to switch this round somehow, so that I have an "extra"
that *removes* some of the dependencies?

(I could have 2 projects, a core one and a cmdline one that depends on
the first and adds the command-line API. I don't really like that
option, though, not least because it means maintaining 2 projects
rather than one, so I'm exploring whether there are other ways of
achieving the objective).

Any thoughts on how I could do this?


More information about the Distutils-SIG mailing list