Skip to content
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

update pants peek docs with latest outputs (Cherry-pick of #22051) #22053

Merged
merged 1 commit into from
Mar 6, 2025
Merged
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
51 changes: 31 additions & 20 deletions docs/docs/using-pants/project-introspection.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -230,29 +230,29 @@ helloworld/greet/translations.json
`peek` outputs JSON for each target specified.

```bash
$ pants peek helloworld/util:tests
$ pants peek helloworld/greet:tests
[
{
"address": "helloworld/util:tests",
"address": "helloworld/greet:tests",
"target_type": "python_tests",
"dependencies": null,
"dependencies": [
"helloworld/greet/greeting_test.py:tests"
],
"description": null,
"interpreter_constraints": null,
"overrides": null,
"skip_black": false,
"skip_docformatter": false,
"skip_flake8": true,
"skip_flake8": false,
"skip_isort": false,
"skip_mypy": false,
"sources": [
"*.py",
"*.pyi",
"!test_*.py",
"!*_test.py",
"!tests.py",
"!conftest.py",
"!test_*.pyi",
"!*_test.pyi",
"!tests.pyi"
"helloworld/greet/greeting_test.py"
],
"sources_fingerprint": "2158e096d5ab63e537d88067b50a0274b83f6373143faf854d4a9adf5d01cf78",
"sources_raw": [
"test_*.py",
"*_test.py",
"tests.py"
],
"tags": null
}
Expand All @@ -262,12 +262,18 @@ $ pants peek helloworld/util:tests
You can use `--exclude-defaults` for less verbose output:

```bash
$ pants peek --exclude-defaults helloworld/util:tests
$ pants peek --exclude-defaults helloworld/greet:tests
[
{
"address": "helloworld/util:tests",
"address": "helloworld/greet:tests",
"target_type": "python_tests",
"skip_flake8": true,
"dependencies": [
"helloworld/greet/greeting_test.py:tests"
],
"sources": [
"helloworld/greet/greeting_test.py"
],
"sources_fingerprint": "2158e096d5ab63e537d88067b50a0274b83f6373143faf854d4a9adf5d01cf78"
}
]
```
Expand All @@ -288,7 +294,7 @@ helloworld/util:lib
Some introspection goals, such as `filter`, `dependencies` and `dependents` emit a flat list of target addresses. It's often useful to expand each of those into a full JSON structure with detailed properties of each target, by piping to `pants peek`:

```bash
pants dependents helloworld/main.py:lib | xargs pants peek --exclude-defaults
$ pants dependents helloworld/main.py:lib | xargs pants peek --exclude-defaults
[
{
"address": "helloworld:lib",
Expand All @@ -300,7 +306,8 @@ pants dependents helloworld/main.py:lib | xargs pants peek --exclude-defaults
"sources": [
"helloworld/__init__.py",
"helloworld/main.py"
]
],
"sources_fingerprint": "74841d8cb2060cf9a4c2aa20f77c2a1a44af4799188a5820e513776fd3fe973c"
},
{
"address": "helloworld:pex_binary",
Expand All @@ -311,7 +318,11 @@ pants dependents helloworld/main.py:lib | xargs pants peek --exclude-defaults
"entry_point": {
"module": "main.py",
"function": null
}
},
"goals": [
"package",
"run"
]
}
]
```
Expand Down