<@UB2J9BQA0>: fwiw, an incantation that replaces t...
# development
w
@hundreds-father-404: fwiw, an incantation that replaces the
--type
arg on `dependencies`:
Copy code
./pants dependencies --transitive :: | xargs ./pants filter --target-type=python_requirement_library | xargs ./pants peek | jq '.[]["requirements"][]'
was talking with @happy-kitchen-89482 about it a bit, and although we don’t fully agree, it seems like an option to deprecate the
dependencies --type
flag
h
definitely more consistent. I support that until we have a more generic "query"
w
it also seem like
peek
could gain the ability to render a single field, to avoid the need for
jq
? a bit complicated here though because it’s a single entry list in this case
(thanks again for adding that @flat-zoo-31952!)
🙏 1
🙏🏻 1
h
Yeah I think
./pants peek --field=requirements
. Unclear if you warn, error, or ignore when the target doesn't have that? What if it instead filtered out all targets w/o the field, so
./pants peek --field=requirements ::
is like
./pants filter --target-type=python_requirement_library | xargs ./pants peek --field-requirements
w
hm, i don’t think the filtering is the issue i see: more that
requirements
is a string list: if you just dump it, your output is a list of string lists
hence the
jq
bit
…or, hence the trailing
[]
on the
jq
h
oh, hm, yeah, I don't think
./pants peek --flatten
or
./pants peek --merge
makes sense because some fields aren't mergable, like the
setup_py()
field of
python_distribution
f
that's actually why I thought that just leaving it as json was the easiest move... you're outputting arbitrary data structures, so you don't know how you want to handle things like "flattening" in the general case
1
w
yep. good call.
h
As long as we document a couple cool/useful queries for users, both in the docsite and probably
./pants help
, I think this is a great idea to fix. Don't make them figure out this incantation for req strings
--type
is so broken I don't think it's worth salvaging
And I also am still interested in how we could merge
filedeps
and
dependencies
- did y'all discuss that by chance?
w
we didn’t, no.
👍 1