|
1 | 1 | Installing Pants
|
2 | 2 | ================
|
3 | 3 |
|
4 |
| -There are a few ways to get a runnable version of pants set up for your workspace. Before |
5 |
| -beginning, make sure your machine fits the requirements. At a minimum, pants requires the following to run properly: |
| 4 | +There are a few ways to get a runnable version of Pants set up for your workspace. Before |
| 5 | +beginning, make sure your machine fits the requirements. At a minimum, Pants requires the following to run properly: |
6 | 6 |
|
7 |
| -* Linux or Mac OS X. |
8 |
| -* Python 2.7.x (the latest stable version of 2.7 is recommended). |
| 7 | +* Linux or macOS. |
| 8 | +* Python 2.7 or 3.6. |
9 | 9 | * A C compiler, system headers, Python headers (to compile native Python modules) and the libffi
|
10 | 10 | library and headers (to compile and link modules that use CFFI to access native code).
|
11 | 11 | * OpenJDK or Oracle JDK 7 or greater.
|
12 |
| -* Internet access (so that pants can fully bootstrap itself) |
| 12 | +* Internet access (so that Pants can fully bootstrap itself) |
13 | 13 |
|
14 |
| -After you have pants installed, you'll need to |
| 14 | +After you have Pants installed, you'll need to |
15 | 15 | [[Set up your code workspace to work with Pants|pants('src/docs:setup_repo')]].
|
16 | 16 |
|
17 | 17 | Recommended Installation
|
18 | 18 | ------------------------
|
19 | 19 |
|
20 |
| -To set up pants in your repo, we recommend installing our self-contained `pants` bash script |
21 |
| -in the root (ie, "buildroot") of your repo: |
| 20 | +To set up Pants in your repo, we recommend installing our self-contained `pants` bash script |
| 21 | +in the root (i.e. the "buildroot") of your repo: |
22 | 22 |
|
23 | 23 | :::bash
|
24 |
| - curl -L -O https://pantsbuild.github.io/setup/pants && chmod +x pants && touch pants.ini |
| 24 | + curl -L -O https://pantsbuild.github.io/setup/pants && chmod +x pants |
25 | 25 |
|
26 |
| -The first time you run the new `./pants` script it will install the latest version of pants (using |
27 |
| -virtualenv) and then run it. It's recommended though, that you pin the version of pants. To do |
28 |
| -this, first find out the version of pants you just installed: |
| 26 | +Start by running the below command to auto-generate a `pants.ini` config file with sensible defaults. |
29 | 27 |
|
30 | 28 | :::bash
|
31 |
| - ./pants -V |
32 |
| - 1.0.0 |
| 29 | + ./pants generate-pants-ini |
33 | 30 |
|
34 |
| -Then add an entry like so to `pants.ini` with that version: |
| 31 | +This command pins the `pants_version`. When you'd like to upgrade Pants, just edit the version in `pants.ini` and `./pants` will self-update on the next run. |
35 | 32 |
|
36 |
| - :::ini |
37 |
| - [GLOBAL] |
38 |
| - pants_version: 1.0.0 |
39 |
| - |
40 |
| -When you'd like to upgrade pants, just edit the version in `pants.ini` and pants will self-update on |
41 |
| -the next run. This script stores the various pants versions you use centrally in |
42 |
| -`~/.cache/pants/setup`. When you switch back and forth between branches pants will select the |
43 |
| -correct version from your local cache and use that. |
44 |
| - |
45 |
| -If you use pants plugins published to pypi you can configure them by adding a `plugins` list as |
46 |
| -follows: |
| 33 | +To use Pants plugins published to PyPi, add them to a `plugins` list, like so: |
47 | 34 |
|
48 | 35 | :::ini
|
49 | 36 | [GLOBAL]
|
50 |
| - pants_version: 1.0.0 |
| 37 | + pants_version: 1.15.0 |
51 | 38 |
|
52 | 39 | plugins: [
|
53 | 40 | 'pantsbuild.pants.contrib.go==%(pants_version)s',
|
54 | 41 | 'pantsbuild.pants.contrib.scrooge==%(pants_version)s',
|
55 | 42 | ]
|
56 | 43 |
|
57 |
| -Pants notices you changed your plugins and it installs them. |
58 |
| -NB: The formatting of the plugins list is important; all lines below the `plugins:` line must be |
59 |
| -indented by at least one white space to form logical continuation lines. This is standard for python |
60 |
| -ini files, see [[Options|pants('src/docs:options')]]. |
| 44 | +Pants will notice you changed your plugins and will install them the next time you run `./pants`. |
| 45 | + |
| 46 | +Note that the formatting of the plugins list is important; all lines below the `plugins:` line must be |
| 47 | +indented by at least one white space to form logical continuation lines. This is standard for Python |
| 48 | +ini files. See [[Options|pants('src/docs:options')]] for a guide on modifying your `pants.ini`. |
61 | 49 |
|
62 | 50 | The ./pants Runner Script
|
63 | 51 | -------------------------
|
@@ -98,6 +86,6 @@ where you are attempting to bootstrap pants. In particular, if you see an error
|
98 | 86 | Failed to install requirements from /Users/someuser/workspace/pants/3rdparty/python/requirements.txt.
|
99 | 87 |
|
100 | 88 | This indicates that pants was attempting to `pip install` the `psutil` dependency into it's private
|
101 |
| -virtualenv, and that install failed due to a compiler issue. On Mac OS X, we recommend running |
| 89 | +virtualenv, and that install failed due to a compiler issue. On macOS, we recommend running |
102 | 90 | `xcode-select --install` to make sure you have the latest compiler infrastructure installed, and
|
103 | 91 | unset any compiler-related environment variables (i.e. run `unset CC`).
|
0 commit comments