Skip to content

Commit 2062fd9

Browse files
authored
Fix the README examples, and upgrade to a non-busted Pants. (#97)
1 parent d06a275 commit 2062fd9

2 files changed

Lines changed: 14 additions & 13 deletions

File tree

README.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,25 +37,25 @@ In the latter case, Pants locates target metadata for the source files as needed
3737
Invoking goals on files is straightforward, e.g.,
3838

3939
```
40-
./pants test helloworld/util/lang_test.py
40+
./pants test helloworld/greet/greeting_test.py
4141
```
4242

4343
You can use globs:
4444

4545
```
46-
./pants lint helloworld/util/*.py
46+
./pants lint helloworld/greet/*.py
4747
```
4848

4949
But note that these will be expanded by your shell, so this is equivalent to having used
5050

5151
```
52-
./pants lint helloworld/util/lang.py helloworld/util/lang_test.py helloworld/util/resources.py helloworld/util/resources_test.py
52+
./pants lint helloworld/greet/__init__.py helloworld/greet/greeting.py helloworld/greet/greeting_test.py
5353
```
5454

5555
If you want Pants itself to expand the globs (which is sometimes necessary), you must quote them in the shell:
5656

5757
```
58-
./pants lint 'helloworld/util/*.py'
58+
./pants lint 'helloworld/greet/*.py'
5959
```
6060

6161
You can run on all changed files:
@@ -75,7 +75,7 @@ You can run on all changed files, and any of their "dependees":
7575
Targets are referenced on the command line using their address, of the form `path/to/dir:name`, e.g.,
7676

7777
```
78-
./pants lint helloworld/util:util
78+
./pants lint helloworld/greet:lib
7979
```
8080

8181
You can glob over all targets in a directory with a single trailing `:`, or over all targets in a directory
@@ -125,9 +125,10 @@ Try these out in this repo!
125125

126126
```
127127
./pants test :: # Run all tests in the repo.
128-
./pants test helloworld/util:test # Run all the tests in this target.
129-
./pants test helloworld/util/lang_test.py # Run just the tests in this file.
130-
./pants test helloworld/util/lang_test.py -- -k test_language_translator # Run just this one test.
128+
./pants test --output=all :: # Run all tests in the repo and view pytest output even for tests that passed (you can set this permanently in pants.toml).
129+
./pants test helloworld/translator:tests # Run all the tests in this target.
130+
./pants test helloworld/translator/translator_test.py # Run just the tests in this file.
131+
./pants test helloworld/translator/translator_test.py -- -k test_unknown_phrase # Run just this one test by passing through pytest args.
131132
```
132133

133134
## Create a PEX binary
@@ -136,7 +137,7 @@ Try these out in this repo!
136137
./pants package helloworld/main.py
137138
```
138139

139-
## Run a binary
140+
## Run a binary directly
140141

141142
```
142143
./pants run helloworld/main.py
@@ -145,16 +146,16 @@ Try these out in this repo!
145146
## Open a REPL
146147

147148
```
148-
./pants repl helloworld/greet # The REPL will have all relevant code and dependencies on its sys.path.
149-
./pants repl --shell=ipython helloworld/greet --no-pantsd # To use IPython, you must disable Pantsd for now.
149+
./pants repl helloworld/greet:lib # The REPL will have all relevant code and dependencies on its sys.path.
150+
./pants repl --shell=ipython helloworld/greet:lib --no-pantsd # To use IPython, you must disable Pantsd for now.
150151
```
151152

152153
## Build a wheel / generate `setup.py`
153154

154155
This will build both a `.whl` bdist and a `.tar.gz` sdist.
155156

156157
```
157-
./pants package helloworld/util:dist
158+
./pants package helloworld/translator:dist
158159
```
159160

160161
## Count lines of code

pants.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Licensed under the Apache License, Version 2.0 (see LICENSE).
33

44
[GLOBAL]
5-
pants_version = "2.10.0rc3"
5+
pants_version = "2.10.0rc5"
66
backend_packages.add = [
77
"pants.backend.python",
88
"pants.backend.python.lint.docformatter",

0 commit comments

Comments
 (0)