Manual and advanced installation
If you want to make use of a non-standard Pants installation, for example, using a local source installation of Pants, follow these steps. For streamlined installations that work in most cases, see our installation page.
Manual installation
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, pick a release version. You can see the available releases on PyPI. We recommend picking the current stable release, unless you have reason to need a more recent one, such as a release candidate or a development release.
Then, set up a minimal pants.toml
config file, filling in the version you selected:
printf '[GLOBAL]\npants_version = "X.Y.Z"\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
./pants
to version controlYou should check the ./pants
script into your repo so that all users can easily run Pants.
The ./pants
script will automatically install and use the Pants version specified in pants.toml
, so upgrading Pants is as simple as editing pants_version
in that file.
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=<SHA> in the environment, and run ./pants
as usual:
PANTS_SHA=22c566e78b4dd982958429813c82e9f558957817 ./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
See here for instructions on how to run Pants directly from its sources.
This is useful when making changes directly to Pants, to see how those changes impact your repo.