refined-addition-53644
06/17/2022, 9:57 AMresolve which would show me the resolve(s) for a given target similar to dependencies?
Or what would be a way to get the resolve for a target?
I am trying to debug a case where the test complains that the source file doesn't have the same resolve even though I have set the same resolve for the test and the source.curved-television-6568
06/17/2022, 10:00 AM./pants peek :tgt gives you Pants view of things for all targets matching your CLI specs..refined-addition-53644
06/17/2022, 10:08 AMcurved-television-6568
06/17/2022, 10:27 AMhundreds-father-404
06/17/2022, 2:05 PMpeek says it's Nonerefined-addition-53644
06/17/2022, 2:09 PMpeek. I can't find it anywhere in peek's output. I am pretty sure all of them are using the correct resolve.hundreds-father-404
06/17/2022, 2:12 PM[
{
"address": "src/python/pants/util/strutil.py",
"target_type": "python_source",
...
"interpreter_constraints": null,
"resolve": null,
"skip_autoflake": false,
"skip_black": false,
...
}
]refined-addition-53644
06/17/2022, 2:14 PM[
{
"address": "src/pyfleet-vehicle-spec/tests:tests",
"target_type": "python_tests",
"dependencies": [
"src/pyfleet-vehicle-spec/tests/test_main.py",
"src/pyfleet-vehicle-spec/tests/test_panion_ds_vehicle_specs.py"
],
"description": null,
"overrides": null,
"skip_autoflake": false,
"skip_bandit": false,
"skip_black": false,
"skip_docformatter": false,
"skip_flake8": false,
"skip_isort": false,
"skip_mypy": false,
"sources": [
"src/pyfleet-vehicle-spec/tests/test_main.py",
"src/pyfleet-vehicle-spec/tests/test_panion_ds_vehicle_specs.py"
],
"sources_raw": [
"test_*.py",
"*_test.py",
"tests.py"
],
"tags": null
}
]refined-addition-53644
06/17/2022, 2:16 PMpython_sources(name="tests", resolve="vehicle_spec")hundreds-father-404
06/17/2022, 2:18 PMpython_test target like ./pants src/pyfleet-vehicle-spec/tests/test_panion_ds_vehicle_specs.py
What's going on is that the target generator python_tests (with an s) "moves" the field to generated targets and doesn't keep it itself. That was necessary for parametrize() + overrides to work properly
cc @witty-crayon-22786, not sure how we could avoid user confusion here. It is definitely nuanced, and currently undocumentedrefined-addition-53644
06/17/2022, 2:18 PM2.11.1rc2hundreds-father-404
06/17/2022, 2:21 PMpeek on a target generator, add a key for generated_targets with a list of the addresses of everything generated
A conceptual change in 2.11 is we leaned more into "target generators solely exist for boilerplate reduction". peek became less useful for target generators. "atom targets" are where all the interesting stuff happens