Hey! These docs are for version 2.8, which is no longer officially supported. Click here for the latest version, 2.11!

Installing Pants

Creating the launch script

Pants is invoked via a launch script named ./pants , saved at the root of the repository. This script will install Pants and handle upgrades.

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

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

Then, download the script:

curl -L -O https://static.pantsbuild.org/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.

Running Pants from unreleased builds

To use an unreleased build of Pants from the pantsbuild/pants main branch, locate the main branch SHA, set PANTS_SHA= in the environment, and run ./pants as usual:

PANTS_SHA=cd0e1e7b2ad1f429cf3bb5f83daec035302d1795 ./pants --version

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 ./pants package src/python/pants:pants-packaged to build a wheel.

Running Pants from sources

You can use a pants_from_sources script like this to run Pants from sources in another repository. This is useful when making changes directly to Pants to see how it impacts your project.


Did this page help you?