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

run

Run a pex_binary target.

To run an executable/script, simply use ./pants run on a pex_binary target, like this:

$ ./pants run project/app.py

or

$ ./pants run project:app

You may only run one target at a time.

The program will have access to the same environment used by the parent ./pants process, so you can set environment variables in the external environment, e.g. FOO=bar ./pants run project/app.py. (Pants will auto-set some values like $PATH).

📘

Tip: check the return code

Pants will propagate the return code from the underlying executable. Run echo $? after the Pants run to see the return code.

🚧

Issues finding files?

Run ./pants dependencies --transitive path/to/binary.py to ensure that all the files you need are showing up, including for any resources you intend to use.

Passing arguments

To pass arguments to the script/executable, use -- at the end of the command, like this:

$ ./pants run project/app.py -- --arg1 arg2 arg3

Updated about a month ago


run


Run a pex_binary target.

Suggested Edits are limited on API Reference Pages

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