Skip to content

Commit a4d25c2

Browse files
authored
Upgrade to Pants 2.15 and to scie-pants. (#25)
1 parent 2028724 commit a4d25c2

File tree

6 files changed

+32
-560
lines changed

6 files changed

+32
-560
lines changed

.github/workflows/pants.yaml

+6-9
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,11 @@ jobs:
2525
python-version: [3.9]
2626
steps:
2727
- uses: actions/checkout@v3
28-
- uses: pantsbuild/actions/init-pants@v2
28+
- uses: pantsbuild/actions/init-pants@v4-scie-pants
2929
# This action bootstraps pants and manages 2-3 GHA caches.
3030
# See: github.com/pantsbuild/actions/tree/main/init-pants/
3131
with:
32-
pants-python-version: ${{ matrix.python-version }}
33-
# cache0 makes it easy to bust the cache if needed
34-
# just increase the integer to start with a fresh cache
35-
gha-cache-key: cache0-py${{ matrix.python-version }}
32+
gha-cache-key: v0
3633
# The JVM backend uses named_caches for Coursier state,
3734
# so it is appropriate to invalidate on lockfile changes.
3835
named-caches-hash: ${{ hashFiles('3rdparty/jvm/default.lock') }}
@@ -47,14 +44,14 @@ jobs:
4744
# See https://pants.readme.io/docs/using-pants-in-ci for tips on how to periodically clean it up.
4845
# Alternatively you change gha-cache-key to ignore old caches.
4946
- name: Bootstrap Pants
50-
run: ./pants --version
47+
run: pants --version
5148
- name: Check Pants config files
52-
run: ./pants tailor --check update-build-files --check
49+
run: pants tailor --check update-build-files --check
5350
- name: Lint, compile, and test
54-
run: ./pants lint check test '::'
51+
run: pants lint check test '::'
5552
- name: Package / Run
5653
run: |
57-
./pants package ::
54+
pants package ::
5855
- name: Upload Pants log
5956
uses: actions/upload-artifact@v3
6057
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

+24-22
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,17 @@ for some other example layouts.
1818

1919
# Running Pants
2020

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

2426
# Goals
2527

2628
Pants commands are called _goals_. You can get a list of goals with
2729

2830
```
29-
./pants help goals
31+
pants help goals
3032
```
3133

3234
Most goals take arguments to run on. To run on a single directory, use the directory name with
@@ -36,19 +38,19 @@ end.
3638
For example:
3739

3840
```
39-
./pants lint src: 3rdparty::
41+
pants lint src: 3rdparty::
4042
```
4143

4244
You can run on all changed files:
4345

4446
```
45-
./pants --changed-since=HEAD lint
47+
pants --changed-since=HEAD lint
4648
```
4749

4850
You can run on all changed files, and any of their "dependees":
4951

5052
```
51-
./pants --changed-since=HEAD --changed-dependees=transitive test
53+
pants --changed-since=HEAD --changed-dependees=transitive test
5254
```
5355

5456
# Example Goals
@@ -58,54 +60,54 @@ Try these out in this repo!
5860
## Run `scalafmt` and `google_java_format`
5961

6062
```
61-
./pants fmt :: # Format all files.
62-
./pants fmt src/jvm: # Format only files in this directory (non-recursively).
63-
./pants lint src/jvm:: # Check that all files under `src/jvm` are formatted (recursively).
63+
pants fmt :: # Format all files.
64+
pants fmt src/jvm: # Format only files in this directory (non-recursively).
65+
pants lint src/jvm:: # Check that all files under `src/jvm` are formatted (recursively).
6466
```
6567

6668
## Check compilation
6769

6870
```
69-
./pants check :: # Compile everything.
70-
./pants check src/jvm/org/pantsbuild/example/lib/ExampleLib.java # Compile a file and its deps.
71+
pants check :: # Compile everything.
72+
pants check src/jvm/org/pantsbuild/example/lib/ExampleLib.java # Compile a file and its deps.
7173
```
7274

7375
## Run and debug tests
7476

7577
```
76-
./pants test :: # Run all tests in the repository.
77-
./pants test tests/jvm/org/pantsbuild/example/lib: # Run all the tests in this directory.
78-
./pants test tests/jvm/org/pantsbuild/example/lib/ExampleLibSpec.scala -- -z hello # Run one test method.
79-
./pants test --debug tests/jvm/org/pantsbuild/example/lib/ExampleLibSpec.scala # Debug one file.
78+
pants test :: # Run all tests in the repository.
79+
pants test tests/jvm/org/pantsbuild/example/lib: # Run all the tests in this directory.
80+
pants test tests/jvm/org/pantsbuild/example/lib/ExampleLibSpec.scala -- -z hello # Run one test method.
81+
pants test --debug tests/jvm/org/pantsbuild/example/lib/ExampleLibSpec.scala # Debug one file.
8082
```
8183

8284
## Create a binary file
8385

8486
Writes the result to the `dist/` folder.
8587

8688
```
87-
./pants package src/jvm/org/pantsbuild/example/app: # Build one binary.
88-
./pants package :: # Create all binaries.
89+
pants package src/jvm/org/pantsbuild/example/app: # Build one binary.
90+
pants package :: # Create all binaries.
8991
```
9092

9193
## Determine dependencies
9294

9395
```
94-
./pants dependencies tests/jvm::
95-
./pants dependencies --transitive tests/jvm::
96+
pants dependencies tests/jvm::
97+
pants dependencies --transitive tests/jvm::
9698
```
9799

98100
## Determine dependees
99101

100102
That is, find what code depends on a particular files.
101103

102104
```
103-
./pants dependees src/jvm/org/pantsbuild/example/lib::
104-
./pants dependees --transitive src/jvm/org/pantsbuild/example/lib/ExampleLib.java
105+
pants dependees src/jvm/org/pantsbuild/example/lib::
106+
pants dependees --transitive src/jvm/org/pantsbuild/example/lib/ExampleLib.java
105107
```
106108

107109
## Count lines of code
108110

109111
```
110-
./pants count-loc '**/*'
112+
pants count-loc '**/*'
111113
```

0 commit comments

Comments
 (0)