I can do this with some scripting, but maybe there...
# general
c
I can do this with some scripting, but maybe there is already a way to list python files that are not used? I vendored in some old code that has a lot of things I don't need and that I don't want to update so that it lints and checks properly.
b
pants peek ::
includes dependency information, so one approach would be to do your own processing based on that, as it sounds like you're aware of. (I don't personally know of a built-in way to do it/prepackaged way to answer that)
c
Thanks, yes, that's what I can do, just hoping I might not need to 🙂
e
This is basically impossible to do in Pants since Pants supports target less goals. In other words answering the question means looking at all the roots of a dependency graph and deciding which ones you personally consider unused. With that human provided input, you can then automate the calculation.
IOW you can
pants run any/file.py
c
yes, I meant unused from a target's point of view. I can list all dependencies and subtract that list from all the files.
e
So you mean files no target globs?
Ok, gotcha.
Conceptually that's a dead man walking FWIW. Pants has no need for targets in most cases. The fact we have them still and use tailor to sweep them under the rug is legacy.
👍🏽 1