[Distutils] How to implement ‘setup.py’ functionality that itself needs third-party distributions

Carl Meyer carl at oddbird.net
Wed Jan 21 03:34:29 CET 2015


On 01/20/2015 07:28 PM, Ben Finney wrote:
> What I need is a way to express “ensure Docutils is installed before
> continuing with other Setuptools actions” in ‘setup.py’. I don't know of
> a neat way to tell Setuptools that.

That is the precise purpose of the `setup_requires` kwarg.

`setup_requires` isn't exactly "neat", though. Among other problems, if
your package is installed via pip, installation of `setup_requires`
dependencies will ignore installation options passed to pip, so for
instance if someone were trying to install your package via an
alternative index or local sdists, setuptools would still go out to PyPI
for the `setup_requires` dependencies.) I would take a step back and
think really hard about how badly your setup.py really needs docutils,
and whether you can avoid doing this at all. There isn't any good way to
do it that I know of. You could try the alternative-setup-requires that
Daniel described and linked to earlier in this thread.

Carl

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20150120/70209a13/attachment.sig>


More information about the Distutils-SIG mailing list