[Distutils] setup_requires for dev environments

Daniel Holth dholth at gmail.com
Mon Mar 16 19:53:15 CET 2015


No one should be asked to learn how to extend distutils, and in
practice no one knows how.

People have been begging for years for working setup_requires, far
longer than I've been interested in it, and all they want to do is

import fetch_version
setup(version=fetch_version(), ...)

Then they will eventually notice setup_requires has never worked the
way most people expect. As a result there are too few setup.py
abstractions.

The other proposal is a little bit interesting. Parse setup.py without
running it, extract setup_requires, and pip install locally before
running the file? It would be easy as long as the setup_requires were
defined as a literal list in the setup() call, but you would have to
tell people they were not allowed to write normal clever Python code.
I think the gotchas would be severe...

Release a setuptools command class that actually works with regular
setup_requires, and parses setup_requires out of a side file? But
fails fetch_version case...

The main reason the installer should handle setup_requires instead of
setup.py is related to one of the major goals of packaging, which is
to get setup.py out of the business of installing (it is OK if it is a
build script).

Would you be interested in a JSON-format metadata that you were
willing to support long term, with a quick version 0.1 release that
only adds the setup_requires feature?


More information about the Distutils-SIG mailing list