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.

Config section: [filter]

Basic options

--filter-output-file=<path>
PANTS_FILTER_OUTPUT_FILE
output_file
default: None
Output 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-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

--filter-type="[[+-]type1,type2,..., [+-]type1,type2,..., ...]"
PANTS_FILTER_TYPE
type
default: []
Deprecated, will be removed in version: 2.1.0.dev0.
Use `--target-type` instead of `--type`.
Filter on these target types, e.g. `resources` or `python_library`.

--filter-regex="[[+-]regex1,regex2,..., [+-]regex1,regex2,..., ...]"
PANTS_FILTER_REGEX
regex
default: []
Deprecated, will be removed in version: 2.1.0.dev0.
Use `--address-regex` instead of `--regex`.
Filter on target addresses matching these regexes.

--filter-target="[[+-]spec1,spec2,..., [+-]spec1,spec2,..., ...]"
PANTS_FILTER_TARGET
target
default: []
Deprecated, will be removed in version: 2.1.0.dev0.
`--filter-target` was removed because it is similar to `--filter-address-regex`. If you still need this feature, please message us on Slack (https://www.pantsbuild.org/docs/community).
Filter on these target addresses.

--filter-ancestor="[[+-]spec1,spec2,..., [+-]spec1,spec2,..., ...]"
PANTS_FILTER_ANCESTOR
ancestor
default: []
Deprecated, will be removed in version: 2.1.0.dev0.
`--filter-ancestor` was removed because it is not trivial to implement. If you still need this feature, please message us on Slack (https://www.pantsbuild.org/docs/community).
Filter on targets that these targets depend on.

Related subsystems

filter

Updated about a month 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.