Middlefield is a framework for building build tools. Since every build tool is different, middlefield is plugin-based.
Every plugin must be registered with
middlefield.COMMAND object collects dependencies and commands.
It is an
Middlefield itself registers two important things:
executoris a dependency that maps to a
self-buildis a command that will rebuild a middlefield pex – with the requested packages added (for plugins)
self-build commands builds a
PEX with the requested plugins.
This allows distributing a single file which knows which middlefield
plugins to use
requirements.txtfile. This option can be given several times (or none)
--packagespecifies a PyPI package name. This option can be given several times (or none)
--outputspecifies the output file. The file will be executable. It is suggested that the name will be something similar to
mf.pex, for consistency.
--shebangspecifies the shebang line the interpreter will use. Often,
/usr/bin/env python3is a good choice – but that depends on the way the Python interpreter is installed.