is there a way to signal to pants' dependency infe...
# general
b
is there a way to signal to pants' dependency inference that an import is happening that it's not otherwise picking up on?
I'll preface this with the code here is very atypical and was done as a workaround and I wouldn't expect pants to special case support for this:
Untitled
"that's crazy!" is a totally valid answer 😝
h
You mean apart from manually adding
dependencies=
to the target?
f
I mean it's a little crazy but I've put stuff crazier than that in prod 😅
h
You can write custom dep inference in a plugin, I believe, @hundreds-father-404 would know more
h
Yep, you can! We haven't written a guide yet for it but it's all pluggable. Lmk if you'd like me to send some instructions First, you need a scheme for how the inference should work, eg these file names should always have this dep, or parse the AST and look for this particular code
b
let me get back to you on that, the existing solution above wasn't ideal in the first place, so I might be better off just addressing that with a better design anyway
👍 1