LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

pants

scalable build system for monorepos

TLDR

List targets
$ pants list ::
copy
Run tests
$ pants test ::
copy
Format code
$ pants fmt ::
copy
Lint code
$ pants lint ::
copy
Build package
$ pants package [path/to:target]
copy
Run specific target
$ pants run [path/to:target]
copy
Check types
$ pants check ::
copy
Show dependencies
$ pants dependencies [path/to:target]
copy

SYNOPSIS

pants [options] goal [targets...]

DESCRIPTION

pants is a scalable build system for monorepos. It supports Python, Go, Java, Scala, Shell, and Docker.Target notation uses colons to separate path and target name. Double colons (::) match all targets recursively.Caching and memoization make repeated builds fast. Remote caching enables team-wide build sharing.Dependency inference automatically discovers imports. Explicit dependencies can be declared in BUILD files.Fine-grained invalidation rebuilds only affected targets. Concurrent execution uses available cores.

PARAMETERS

list

List matching targets.
test
Run tests.
fmt
Format source files.
lint
Run linters.
check
Type check.
package
Build package.
run
Run executable target.
dependencies
Show dependencies.
repl
Start interactive REPL.
--changed-since REF
Only changed files.
-l, --level LEVEL
Log level.

CAVEATS

Requires BUILD files defining targets. Initial setup has learning curve. Large codebase initial run can be slow.

HISTORY

Pants was originally developed at Twitter around 2011. Version 2.x was a ground-up rewrite focusing on Python ergonomics. Now maintained by Toolchain as an open-source project.

SEE ALSO

bazel(1), buck(1), make(1), gradle(1)

Copied to clipboard
Kai