Are there ways to perform more complex filters wit...
# general
h
Are there ways to perform more complex filters with the pants interface? Say instead of
--filter-address-regex
I wanted to filter for all
python_distribution
targets with
interpreter_constraints==parametrize("==3.9", "==3,10")
(I forget the syntax off the top of my head), is there a way to do that that I’m missing? Doing a
pants peek
+
jq
works for this but would be useful to stay within the interface.
c
for targets with parametrized fields, those show up in the address:
src/path:name@interpreter_constraints=py39
etc.. (if your parametrize value is verbose, you can assign it an alias as:
interpreter_constraints=parametrize(py39="==3.9", ...)
)
interestingly enough, this is a precise use case for what I've been playing with recently: https://pantsbuild.slack.com/archives/C0D7TNJHL/p1717169536820929
🙌 1
h
Nice! The simple use case I have rn is relating a distribution target to its provided artifact. Works great in one direction with the target as a “base” with
--filter-address
+ a bit of jq but the other direction is a lot more jq. It’s be nice for both of these to use the same mechanism.