cool-easter-32542
05/07/2024, 11:20 PMpeek now can indicate some goals that apply for some targets (very cool). It looks like this mostly works for single-file targets, not generators like python_tests. Those generators are valid sources of some goals (e.g. test, lint etc.), although not all goals that they're isolated files are valid for (e.g. run only works with one file).
In https://github.com/pantsbuild/example-python (at 55cf90bc4a1e4ccc47749aa39d299b5dace79adc), running PANTS_VERSION=2.21.0a0 pants peek --exclude-defaults helloworld/greet:tests helloworld/greet/greeting_test.py (--exclude-defaults just to make this output nicer):
[
{
"address": "helloworld/greet:tests",
"target_type": "python_tests",
"dependencies": [
"helloworld/greet/greeting_test.py:tests"
],
"sources": [
"helloworld/greet/greeting_test.py"
],
"sources_fingerprint": "2158e096d5ab63e537d88067b50a0274b83f6373143faf854d4a9adf5d01cf78"
},
{
"address": "helloworld/greet/greeting_test.py:tests",
"target_type": "python_test",
"dependencies": [
"helloworld/greet/greeting.py:lib"
],
"goals": [
"run",
"test"
],
"source_raw": "greeting_test.py",
"sources": [
"helloworld/greet/greeting_test.py"
],
"sources_fingerprint": "2158e096d5ab63e537d88067b50a0274b83f6373143faf854d4a9adf5d01cf78"
}
]
Note that:
• helloworld/greet:tests has no goals key
• helloworld/greet/greeting_test.py:tests does have one
Describe the solution you'd like
Include appropriate goals output for target generators too, somehow.
Describe alternatives you've considered
N/A
Additional context
N/A
pantsbuild/pants