[Distutils] mebs, the meta-build system

Daniel Holth dholth at gmail.com
Thu Oct 18 05:25:33 CEST 2012


or, removing distutils without replacing it.

** not an actual project **

Proposing mebs, the meta-build system.

What if pip did not depend on setuptools or distutils and the stdlib
did not include distutils or any other build system? Instead, the
installer can only install binary packages, and build systems do not
install but only build binary packages.

A very simple meta-build system "mebs" is used to recognize sdists and
build binary packages. Build systems provide plugins having three
methods,

.recognize()
.metadata()
.build()

An installer downloads an sdist. For each installed build plugin,
.recognize(dir) is called. The first plugin to return True is used.

The plugin's .metadata(dir) is called, returning Metadata 1.3+ format
metadata in a simple email.parser.Parser() multi-dict interface. Used
to fetch any build/install requirements.

.build(dir) is called to create the binary package.

The installer installs the binary package.


The first time you download an sdist, the build system/installer has
to download a pre-built binary package of distutils (because it has
been removed from the standard library). Alternatively a minimal
setup.cfg build_system=x is consulted to download something other than
distutils, the newly installed build plugin recognizes the sdist, and
the package is built and installed.

You wouldn't have to actually remove distutils, but every other build
system could be made to compete with it on equal footing. Binary
packages are used as the lingua franca because, unlike build systems,
binary packages are simple enough that there can be multiple
compatible implementations.


More information about the Distutils-SIG mailing list