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


Options controlling which dependencies will be inferred for Python targets.

Config section: [python-infer]

Basic options


default: True

Infer a target's imported dependencies by parsing import statements from sources.


default: False

Infer a target's dependencies based on strings that look like dynamic dependencies, such as Django settings files expressing dependencies as strings. To ignore any false positives, put `!{bad_address}` in the `dependencies` field of your target.


default: False

Infer a target's dependencies on any files existing for the packages it is located in (recursively upward in the directory structure).

Even if this is disabled, Pants will still include any ancestor files, only they will not be 'proper' dependencies, e.g. they will not show up in ./pants dependencies and their own dependencies will not be used.

If you have empty files, it's safe to leave this option off; otherwise, you should enable this option.


default: True

Infer a test target's dependencies on any files in the current directory and ancestor directories.


default: True

Infer dependencies on binary targets' entry points, e.g. `pex_binary`'s `entry_point` field and `python_awslambda`'s `handler` field.

Advanced options


Deprecated options


Updated about a month ago


Suggested Edits are limited on API Reference Pages

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