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
./pants filter [args]

Filter the input targets based on various criteria.

Most of the filtering options below are comma-separated lists of filtering criteria, with an implied logical OR between them, so that a target passes the filter if it matches any of the criteria in the list. A '-' prefix inverts the sense of the entire comma-separated list, so that a target passes the filter only if it matches none of the criteria in the list.

Each of the filtering options may be specified multiple times, with an implied logical AND between them.

Config section: [filter]

Basic options

output_file

--filter-output-file=<path>
PANTS_FILTER_OUTPUT_FILE
default: None

Output the goal's stdout to this file. If unspecified, outputs to stdout.


--filter-sep=<separator>
PANTS_FILTER_SEP
sep
default: \n

String to use to separate lines in line-oriented output.


--filter-target-type="[[+-]type1,type2,..., [+-]type1,type2,..., ...]"
PANTS_FILTER_TARGET_TYPE
target_type
default: []

Filter on these target types, e.g. `resources` or `python_library`.


--filter-granularity=<TargetGranularity>
PANTS_FILTER_GRANULARITY
granularity
one of: all, file, BUILD
default: all

Filter to rendering only targets declared in BUILD files, only file-level targets, or all targets.


--filter-address-regex="[[+-]regex1,regex2,..., [+-]regex1,regex2,..., ...]"
PANTS_FILTER_ADDRESS_REGEX
address_regex
default: []

Filter on target addresses matching these regexes.


--filter-tag-regex="[[+-]regex1,regex2,..., [+-]regex1,regex2,..., ...]"
PANTS_FILTER_TAG_REGEX
tag_regex
default: []

Filter on targets with tags matching these regexes.


Advanced options

None

Deprecated options

None

Related subsystems

filter

Updated 21 days ago


filter


Suggested Edits are limited on API Reference Pages

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