Middlefield¶
Middlefield is a framework for building build tools. Since every build tool is different, middlefield is plugin-based.
Every plugin must be registered with gather
in its setup.py.
Registering¶
The middlefield.COMMAND object collects dependencies and commands.
It is an elcaminoreal.Commands.
Built-in functionality¶
Middlefield itself registers two important things:
executoris a dependency that maps to aseashore.Executor.self-buildis a command that will rebuild a middlefield pex – with the requested packages added (for plugins)
Self Build¶
The self-build commands builds a middlefield-based
PEX with the requested plugins.
This allows distributing a single file which knows which middlefield
plugins to use
Options:
--requirementstakes arequirements.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 tomformf.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.