Skip to content

Commit cd2ae65

Browse files
author
Benjy Weinberger
authored
Upgrade to Pants 2.15 and to scie-pants (#11)
1 parent 50d3fa0 commit cd2ae65

File tree

6 files changed

+29
-559
lines changed

6 files changed

+29
-559
lines changed

.github/workflows/pants.yaml

+7-12
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,15 @@ jobs:
1919
name: Perform CI Checks
2020
needs: org-check
2121
runs-on: ubuntu-20.04
22-
strategy:
23-
matrix:
24-
# The python version to run Pants itself on.
25-
python-version: [3.9]
2622
steps:
2723
- uses: actions/checkout@v3
28-
- uses: pantsbuild/actions/init-pants@v2
24+
- uses: pantsbuild/actions/init-pants@v4-scie-pants
2925
# This action bootstraps pants and manages 2-3 GHA caches.
3026
# See: github.com/pantsbuild/actions/tree/main/init-pants/
3127
with:
32-
pants-python-version: ${{ matrix.python-version }}
33-
# cache0 makes it easy to bust the cache if needed
28+
# v0 makes it easy to bust the cache if needed
3429
# just increase the integer to start with a fresh cache
35-
gha-cache-key: cache0-py${{ matrix.python-version }}
30+
gha-cache-key: v0
3631
# The Kotlin backend uses named_caches for Coursier state,
3732
# so it is appropriate to invalidate on lockfile changes.
3833
named-caches-hash: ${{ hashFiles('3rdparty/jvm/default.lock') }}
@@ -47,14 +42,14 @@ jobs:
4742
# See https://pants.readme.io/docs/using-pants-in-ci for tips on how to periodically clean it up.
4843
# Alternatively you change gha-cache-key to ignore old caches.
4944
- name: Bootstrap Pants
50-
run: ./pants --version
45+
run: pants --version
5146
- name: Check Pants config files
52-
run: ./pants tailor --check update-build-files --check
47+
run: pants tailor --check update-build-files --check
5348
- name: Lint, compile, and test
54-
run: ./pants lint check test '::'
49+
run: pants lint check test '::'
5550
- name: Package / Run
5651
run: |
57-
./pants package ::
52+
pants package ::
5853
- name: Upload Pants log
5954
uses: actions/upload-artifact@v3
6055
with:

3rdparty/jvm/default.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This lockfile was autogenerated by Pants. To regenerate, run:
22
#
3-
# ./pants generate-lockfiles
3+
# pants generate-lockfiles
44
#
55
# --- BEGIN PANTS LOCKFILE METADATA: DO NOT EDIT OR REMOVE ---
66
# {

README.md

+20-18
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,17 @@ for some other example layouts.
1313

1414
# Running Pants
1515

16-
You run Pants goals using the `./pants` wrapper script, which will bootstrap the
17-
configured version of Pants if necessary.
16+
You run Pants goals using the `pants` launcher binary, which will bootstrap the
17+
version of Pants configured for this repo if necessary.
18+
19+
See [here](https://www.pantsbuild.org/docs/installation) for how to install the `pants` binary.
1820

1921
# Goals
2022

2123
Pants commands are called _goals_. You can get a list of goals with
2224

2325
```
24-
./pants help goals
26+
pants help goals
2527
```
2628

2729
Most goals take arguments to run on. To run on a single directory, just use the directory name.
@@ -30,19 +32,19 @@ To recursively run on a directory and all its subdirectories, add `::` to the en
3032
For example:
3133

3234
```
33-
./pants lint src: 3rdparty::
35+
pants lint src: 3rdparty::
3436
```
3537

3638
You can run on all changed files:
3739

3840
```
39-
./pants --changed-since=HEAD lint
41+
pants --changed-since=HEAD lint
4042
```
4143

4244
You can run on all changed files, and any of their "dependees":
4345

4446
```
45-
./pants --changed-since=HEAD --changed-dependees=transitive test
47+
pants --changed-since=HEAD --changed-dependees=transitive test
4648
```
4749

4850
# Example Goals
@@ -52,45 +54,45 @@ Try these out in this repo!
5254
## Run `ktlint`
5355

5456
```
55-
./pants fmt :: # Format all files.
56-
./pants fmt src/jvm # Format only files in this directory (non-recursively).
57-
./pants lint src/jvm:: # Check that all files under `src/jvm` are formatted (recursively).
57+
pants fmt :: # Format all files.
58+
pants fmt src/jvm # Format only files in this directory (non-recursively).
59+
pants lint src/jvm:: # Check that all files under `src/jvm` are formatted (recursively).
5860
```
5961

6062
## Check compilation
6163

6264
```
63-
./pants check :: # Compile everything.
64-
./pants check src/jvm/org/pantsbuild/example/json/JsonExample.kt # Compile a file and its deps.
65+
pants check :: # Compile everything.
66+
pants check src/jvm/org/pantsbuild/example/json/JsonExample.kt # Compile a file and its deps.
6567
```
6668

6769
## Create a binary file
6870

6971
Writes the result to the `dist/` folder.
7072

7173
```
72-
./pants package src/jvm/org/pantsbuild/example/json # Build binaries in this directory.
73-
./pants package :: # Create all binaries.
74+
pants package src/jvm/org/pantsbuild/example/json # Build binaries in this directory.
75+
pants package :: # Create all binaries.
7476
```
7577

7678
## Determine dependencies
7779

7880
```
79-
./pants dependencies src/jvm::
80-
./pants dependencies --transitive src/jvm::
81+
pants dependencies src/jvm::
82+
pants dependencies --transitive src/jvm::
8183
```
8284

8385
## Determine dependees
8486

8587
That is, find what code depends on a particular files.
8688

8789
```
88-
./pants dependees src/jvm/org/pantsbuild/example/json::
89-
./pants dependees --transitive src/jvm/org/pantsbuild/example/json/JsonExample.kt
90+
pants dependees src/jvm/org/pantsbuild/example/json::
91+
pants dependees --transitive src/jvm/org/pantsbuild/example/json/JsonExample.kt
9092
```
9193

9294
## Count lines of code
9395

9496
```
95-
./pants count-loc ::
97+
pants count-loc ::
9698
```

0 commit comments

Comments
 (0)