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

Installing Pants

Prerequisites

To run Pants, you need:

  • Linux (x86_64) or macOS.
  • Python 3.6+ discoverable on your PATH.
  • Internet access (so that Pants can fully bootstrap itself).

🚧

Some Linux distributions may need additional packages

On Ubuntu you may need to run:
apt install -y python3-dev python3-distutils.

🚧

Alpine Linux is not yet supported

Pants for Linux is currently distributed as a manylinux wheel. Alpine Linux is not covered by manylinux (it uses MUSL libc while manylinux requires glibc), so at present Pants will not run on Alpine Linux.

If you need to run Pants on Alpine, let us know, so we can prioritize this work.

Meanwhile, you can try building Pants yourself on Alpine.

🚧

Linux on ARM is not yet supported

Pants for Linux is currently only distributed as an x86_64 wheel.

If you need to run Pants on ARM, let us know, so we can prioritize this work.

Meanwhile you can try building Pants yourself on ARM.

📘

Python 2 compatibility

Pants requires Python 3.6+ to run itself, but it can build Python 2 code.

📘

Using a proxy?

See Proxies for instructions.

Creating the launch script

Pants is invoked via a launch script named ./pants , saved at the root of the repository.

First, set up a minimal pants.toml config file to instruct the script to download the latest 2.1.x release:

printf '[GLOBAL]\npants_version = "2.1.0"\n' > pants.toml

Then, download the script:

curl -L -o ./pants https://pantsbuild.github.io/setup/pants && \
chmod +x ./pants

Now, run this to bootstrap Pants and to verify the version it installs:

./pants --version

📘

Tip: add ./pants to version control

This will allow all users in the project to use Pants without having to install it themselves.

Building Pants from sources

We currently distribute Pants for Linux (x86_64) and MacOS.

If you need to run Pants on some other platform, such as Linux on ARM, or Alpine Linux, you can try building it yourself by checking out the Pants repo, and running build-support/bin/release.sh -q.

Updated 5 days ago


Installing Pants


Suggested Edits are limited on API Reference Pages

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