Pants v2: Fast, consistent builds for Python and more

Welcome to the Pants v2 documentation hub!

Pants v2 is a fast, scalable 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

Backends

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:

[GLOBAL]
backend_packages = ["pants.backend.python"]

Updated 2 months ago


Backends


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.