https://pantsbuild.org/ logo
#general
Title
# general
w

wonderful-iron-54019

11/13/2020, 5:39 PM
Hi friends! this is most likely a lazy question but, we just migrated a part of our build flow from v1 -> v2 and have started to receive an error when there are no targets that match the given rule, anyway to ignore that error? Example error in thread
Copy code
pants.engine.target.NoValidTargetsException: The `publish` goal only works with the following target types:
  * python_binary
  * python_dist
  * python_grpcio_library
  * python_library
  * python_tests
  * python_thrift_library

You specified ``, which only included the following target types:
  *
h

hundreds-father-404

11/13/2020, 5:42 PM
Yes, are you using
TargetsToValidFieldSetsRequest
still? Set
error_if_no_valid_targets=False
w

wonderful-iron-54019

11/13/2020, 5:42 PM
let me check!
wowowow so simple
😄 1
thanks eric
❤️ 1
h

hundreds-father-404

11/13/2020, 5:46 PM
(This is an example of why we’re so giddy about the Rules API. It makes it easy to factor out common functionality like this
TargetsToValidFieldSetsRequest
thing, while getting caching and parallelization for free)