What is a build frontend?
A build frontend is a tool that invokes build backends to create Python packages. It provides the user interface and orchestrates the build process while delegating the build work to build backends.
Common Build Frontends
- pip: Default package installer, builds during installation
- build: Dedicated PEP 517 builder from PyPA
- uv: High-performance alternative to pip
- poetry/hatch/pdm: Full-featured project management tools with build capabilities
Key Responsibilities
- Discovering and loading build backends
- Managing build environments
- Handling build configuration
- Processing build output (wheels/sdists)
- Reporting build progress and errors
ℹ️
Build frontends implement PEP 517’s standardized interface for interacting with build backends, ensuring consistent behavior across different tools.
Example Usage
Using the build
frontend to create distributions:
python -m build . # Build both wheel and sdist
python -m build --wheel . # Build only wheel
python -m build --sdist . # Build only sdist
Using uv as a build frontend:
uv build # Build both formats
uv build --sdist # Build only sdist
uv build --wheel # Build only wheel
The separation between frontends and backends allows tools to focus on their strengths while maintaining compatibility through standardized interfaces.
Last updated on