https://pantsbuild.org/ logo
f

flat-zoo-31952

07/29/2022, 9:00 PM
Is there a way to abuse parametrized targets to make say, one target for tests and prod that excludes
TYPE_CHECKING
deps, while another goes with the default and uses them?
h

hundreds-father-404

07/29/2022, 9:16 PM
This works:
dependencies=parametrize(dev=["3rdparty/python#pex")], prod=[])
. You could use
!
ignores to opt out of the type stubs But, Pants's dep inference won't be happy because 2 targets own the same file, and they both belong in the same "resolve" (lockfile) Instead, have you considered with the
pex_binary
using
!!
excludes? They're transitive excludes -- no matter what, the dep should not come up
f

flat-zoo-31952

07/29/2022, 9:32 PM
That's a decent idea, I could use transitive excludes on tests for now
3 Views