https://pantsbuild.org/ logo
#general
Title
# general
b

big-fall-51153

05/14/2021, 3:07 PM
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

happy-kitchen-89482

05/14/2021, 3:39 PM
You mean apart from manually adding
dependencies=
to the target?
f

flat-zoo-31952

05/14/2021, 3:39 PM
I mean it's a little crazy but I've put stuff crazier than that in prod 😅
h

happy-kitchen-89482

05/14/2021, 3:39 PM
You can write custom dep inference in a plugin, I believe, @hundreds-father-404 would know more
h

hundreds-father-404

05/14/2021, 3:52 PM
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

big-fall-51153

05/14/2021, 3:58 PM
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
2 Views