You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you want Pants itself to expand the globs (which is sometimes necessary), you must quote them in the shell:
60
62
61
63
```
62
-
./pants lint 'helloworld/greet/*.py'
64
+
pants lint 'helloworld/greet/*.py'
63
65
```
64
66
65
67
You can run on all changed files:
66
68
67
69
```
68
-
./pants --changed-since=HEAD lint
70
+
pants --changed-since=HEAD lint
69
71
```
70
72
71
73
You can run on all changed files, and any of their "dependees":
72
74
73
75
```
74
-
./pants --changed-since=HEAD --changed-dependees=transitive test
76
+
pants --changed-since=HEAD --changed-dependees=transitive test
75
77
```
76
78
77
79
## Target specifications
78
80
79
81
Targets are referenced on the command line using their address, of the form `path/to/dir:name`, e.g.,
80
82
81
83
```
82
-
./pants lint helloworld/greet:lib
84
+
pants lint helloworld/greet:lib
83
85
```
84
86
85
87
You can glob over all targets in a directory with a single trailing `:`, or over all targets in a directory
86
88
and all its subdirectories with a double trailing `::`, e.g.,
87
89
88
90
```
89
-
./pants lint helloworld::
91
+
pants lint helloworld::
90
92
```
91
93
92
94
## Globbing semantics
@@ -96,7 +98,7 @@ For example, if you run the `test` goal over a set of files that includes non-te
96
98
those, rather than error. So you can safely do things like
97
99
98
100
```
99
-
./pants test ::
101
+
pants test ::
100
102
```
101
103
102
104
To run all tests.
@@ -108,67 +110,67 @@ Try these out in this repo!
108
110
## List targets
109
111
110
112
```
111
-
./pants list :: # All targets.
112
-
./pants list 'helloworld/**/*.py' # Just targets containing Python code.
113
+
pants list :: # All targets.
114
+
pants list 'helloworld/**/*.py' # Just targets containing Python code.
113
115
```
114
116
115
117
## Run linters and formatters
116
118
117
119
```
118
-
./pants lint ::
119
-
./pants fmt helloworld/greet::
120
+
pants lint ::
121
+
pants fmt helloworld/greet::
120
122
```
121
123
122
124
## Run MyPy
123
125
124
126
```
125
-
./pants check ::
127
+
pants check ::
126
128
```
127
129
128
130
## Run tests
129
131
130
132
```
131
-
./pants test :: # Run all tests in the repo.
132
-
./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).
133
-
./pants test helloworld/translator:tests # Run all the tests in this target.
134
-
./pants test helloworld/translator/translator_test.py # Run just the tests in this file.
135
-
./pants test helloworld/translator/translator_test.py -- -k test_unknown_phrase # Run just this one test by passing through pytest args.
133
+
pants test :: # Run all tests in the repo.
134
+
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).
135
+
pants test helloworld/translator:tests # Run all the tests in this target.
136
+
pants test helloworld/translator/translator_test.py # Run just the tests in this file.
137
+
pants test helloworld/translator/translator_test.py -- -k test_unknown_phrase # Run just this one test by passing through pytest args.
136
138
```
137
139
138
140
## Create a PEX binary
139
141
140
142
```
141
-
./pants package helloworld/main.py
143
+
pants package helloworld/main.py
142
144
```
143
145
144
146
## Run a binary directly
145
147
146
148
```
147
-
./pants run helloworld/main.py
149
+
pants run helloworld/main.py
148
150
```
149
151
150
152
## Open a REPL
151
153
152
154
```
153
-
./pants repl helloworld/greet:lib # The REPL will have all relevant code and dependencies on its sys.path.
154
-
./pants repl --shell=ipython helloworld/greet:lib --no-pantsd # To use IPython, you must disable Pantsd for now.
155
+
pants repl helloworld/greet:lib # The REPL will have all relevant code and dependencies on its sys.path.
156
+
pants repl --shell=ipython helloworld/greet:lib --no-pantsd # To use IPython, you must disable Pantsd for now.
155
157
```
156
158
157
159
## Build a wheel / generate `setup.py`
158
160
159
161
This will build both a `.whl` bdist and a `.tar.gz` sdist.
0 commit comments