Pants v2: The ergonomic build system

Welcome to the Pants v2 documentation hub!

Pants v2 is a fast, scalable, user-friendly build system for growing codebases. It's currently focused on Python, with support for other languages coming soon.

Here you'll find guides to help you get started with Pants v2, comprehensive documentation on how to configure, run and customize Pants v2, and information on how to get help from the Pants community.

Get Started


How to enable specific functionality.

Pants has some basic, non-language-specific functionality built in to its core. For example, you can count the lines of code under some directory in your repo:

$ ./pants count-loc 'src/**'
Language                 Files     Lines   Blanks  Comments     Code Complexity
Python                      13       155       50        22       83          5
BASH                         2       261       29        22      210         10
JSON                         2        25        0         0       25          0

However most Pants functionality, including all language-specific functionality, is provided via backends.

A backend is a Python package that implements some required functionality, and uses hooks to register itself with Pants. You enable a backend by listing it under the backend_packages config key in pants.toml.

For example, to enable Python support:

backend_packages = ["pants.backend.python"]

Available backends

Activate by adding the backend to the option backend_packages in the [GLOBAL] scope in pants.toml.


What it does



Enables generating an AWS Lambda zip file from Python code.

Python support


Enables generating Python from Protocol Buffers. Includes gRPC support.

Protobuf and gRPC


Core Python support.

Enabling Python support


Adds the py-constraints goal for insights on Python interpreter constraints.

Interpreter compatibility


Enables Bandit, the Python security linter:

Linters and formatters

Enables Black, the Python autoformatter:

Linters and formatters


Enables Docformatter, the Python docstring autoformatter:

Linters and formatters


Enables Flake8, the Python linter:

Linters and formatters


Enables isort, the Python import autoformatter:

Linters and formatters


Enables Pylint, the Python linter:

Linters and formatters


Enables MyPy, the Python type checker:


Updated 4 months ago


How to enable specific functionality.

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.