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.
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.13 release:
printf '[GLOBAL]\npants_version = "2.12.0"\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:
./pantsto version control
You should check the
./pantsscript into your repo so that all users can easily run Pants.
./pantsscript will automatically install and use the Pants version specified in
pants.toml, so upgrading Pants is as simple as editing
pants_versionin that file.
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=22c566e78b4dd982958429813c82e9f558957817 ./pants --version
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.
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.
Updated about 1 year ago