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

fmt

Autoformat source code.

See here for how to opt in to specific formatters, along with how to configure them:

  • Black
  • Docformatter
  • isort

If you activate multiple formatters, Pants will run them sequentially so that they do not overwrite each other. You may need to update each formatter's config file to ensure that it is compatible with the other activated formatters.

🚧

Possible issue with iSort 5's import classifier algorithm

Some Pants users had to explicitly set default_section = "THIRDPARTY" to get iSort 5 to correctly classify their first-party imports, even though this is the default value.

They report that this config works for them:

# pyproject.toml
[tool.isort]
known_first_party = ["my_org"]
default_section = "THIRDPARTY"

You may also want to try downgrading to iSort 4.x by setting version = "isort>=4.6,<5" in the [isort] options scope.

Updated 18 days ago


fmt


Autoformat source code.

Suggested Edits are limited on API Reference Pages

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