curved-television-6568
01/10/2022, 1:36 PM$ ./pants package ::
14:35:21.61 [ERROR] 1 Exception encountered:
InvalidFieldException: Unrecognized field `repositories=['@pypi']` in target src/underpants:dist. Valid fields for the target type `python_distribution`: ['dependencies', 'description', 'entry_points', 'generate_setup', 'provides', 'sdist', 'sdist_config_settings', 'tags', 'wheel', 'wheel_config_settings'].
$ ./pants publish ::
$
That is, the publish
goal was a no-op, where as package correctly informed me there’s a configuration issue (missing the pants.backend.experimental.python
backend)… even update-build-files fails to notice this issue…
cc @hundreds-father-404 any thoughts how to best address this?hundreds-father-404
01/10/2022, 1:49 PMlist
should do the trick.
But it's possible to raise InvalidFieldExceptiob inside a rule rather than via target API, which is lazycurved-television-6568
01/10/2022, 2:04 PMlist
is:
Engine traceback:
in select
in pants.backend.project_info.list_targets.list_targets
in pants.engine.internals.graph.resolve_addresses_from_specs
in pants.engine.internals.build_files.addresses_from_address_specs
in pants.engine.internals.graph.resolve_unexpanded_targets
in pants.engine.internals.graph.resolve_target (src/underpants:dist)
Traceback (most recent call last):
File "/Users/aadt/.cache/pants/setup/bootstrap-Darwin-x86_64/pants.7zfHJF/install/lib/python3.9/site-packages/pants/engine/internals/selectors.py", line 705, in native_engine_generator_send
res = func.send(arg)
File "/Users/aadt/.cache/pants/setup/bootstrap-Darwin-x86_64/pants.7zfHJF/install/lib/python3.9/site-packages/pants/engine/internals/graph.py", line 191, in resolve_target
target = target_type(target_adaptor.kwargs, address, union_membership)
File "/Users/aadt/.cache/pants/setup/bootstrap-Darwin-x86_64/pants.7zfHJF/install/lib/python3.9/site-packages/pants/util/meta.py", line 188, in new_init
prev_init(self, *args, **kwargs)
File "/Users/aadt/.cache/pants/setup/bootstrap-Darwin-x86_64/pants.7zfHJF/install/lib/python3.9/site-packages/pants/engine/target.py", line 339, in __init__
self.field_values = self._calculate_field_values(unhydrated_values, address)
File "/Users/aadt/.cache/pants/setup/bootstrap-Darwin-x86_64/pants.7zfHJF/install/lib/python3.9/site-packages/pants/engine/target.py", line 356, in _calculate_field_values
raise InvalidFieldException(
pants.engine.target.InvalidFieldException: Unrecognized field `repositories=['@pypi']` in target src/underpants:dist. Valid fields for the target type `python_distribution`: ['dependencies', 'description', 'entry_points', 'generate_setup', 'provides', 'sdist', 'sdist_config_settings', 'tags', 'wheel', 'wheel_config_settings'].
And similar for package
publish
doesn’t create the target, as it’s not considered as the backend that would consider it is not active..hundreds-father-404
01/13/2022, 6:01 PMpublish
doesn't create the Target
, given that it calls package
under-the-hood?curved-television-6568
01/13/2022, 7:31 PMpackage
for targets that also has a publish
field set. And with that backend missing, there isn’t one for python_distribution
hundreds-father-404
01/13/2022, 7:32 PMcurved-television-6568
01/13/2022, 7:34 PMhundreds-father-404
01/13/2022, 7:36 PMthat there isn’t a “validate all my targets” goal.The fastest way to do that is
./pants list :: > /dev/null
curved-television-6568
01/13/2022, 7:37 PM[cli.alias]
validate-targets = "list ::"
but.. there’s no redirection support there…. 🤔hundreds-father-404
01/13/2022, 7:42 PMlist_targets.py
if you were motivated enough. Don't have it write to Console
. I think it literally would do nothing more than request Targets
in the rule signatureAllTargets
so that you don't need to specify CLI specscurved-television-6568
01/13/2022, 8:21 PMhundreds-father-404
01/13/2022, 8:23 PM./pants list :: > /dev/null # Validate all targets
in my CI and wouldn't even bother with creating a [cli].alias
because I wouldn't expect users to be running it dailycurved-television-6568
01/13/2022, 8:34 PMlist
and a comment, then too…