Skip to content

Fix the README examples, and upgrade to a non-busted Pants. #97

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 13 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,25 +37,25 @@ In the latter case, Pants locates target metadata for the source files as needed
Invoking goals on files is straightforward, e.g.,

```
./pants test helloworld/util/lang_test.py
./pants test helloworld/greet/greeting_test.py
```

You can use globs:

```
./pants lint helloworld/util/*.py
./pants lint helloworld/greet/*.py
```

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

```
./pants lint helloworld/util/lang.py helloworld/util/lang_test.py helloworld/util/resources.py helloworld/util/resources_test.py
./pants lint helloworld/greet/__init__.py helloworld/greet/greeting.py helloworld/greet/greeting_test.py
```

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

```
./pants lint 'helloworld/util/*.py'
./pants lint 'helloworld/greet/*.py'
```

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

```
./pants lint helloworld/util:util
./pants lint helloworld/greet:lib
```

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

```
./pants test :: # Run all tests in the repo.
./pants test helloworld/util:test # Run all the tests in this target.
./pants test helloworld/util/lang_test.py # Run just the tests in this file.
./pants test helloworld/util/lang_test.py -- -k test_language_translator # Run just this one test.
./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).
./pants test helloworld/translator:tests # Run all the tests in this target.
./pants test helloworld/translator/translator_test.py # Run just the tests in this file.
./pants test helloworld/translator/translator_test.py -- -k test_unknown_phrase # Run just this one test by passing through pytest args.
```

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

## Run a binary
## Run a binary directly

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

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

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

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

```
./pants package helloworld/util:dist
./pants package helloworld/translator:dist
```

## Count lines of code
Expand Down
2 changes: 1 addition & 1 deletion pants.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Licensed under the Apache License, Version 2.0 (see LICENSE).

[GLOBAL]
pants_version = "2.10.0rc3"
pants_version = "2.10.0rc5"
backend_packages.add = [
"pants.backend.python",
"pants.backend.python.lint.docformatter",
Expand Down