short of disabling inference alltogether, is there...
# general
a
short of disabling inference alltogether, is there a way to partition off portions of code? Through whatever process, I've noticed that things like test util code and the likes are leaking into 'production' builds. I also spent a good 30minutes trying to work out why something wasn't working, and it was because my IDEs auto-import picked the wrong class to auto-import and pants just rolled with it.
h
Sounds like what you want is a way to enforce dependency rules? E.g., saying "this thing may not depend on this thing"?
a
yeah. but probably more generically. "Things in //x/y/z can only be accessible by things in //x/y/z" or "`python_test_utils` are cannot be included in
package
targets" or something.
c
a
yeah.
h
Yeah, the main reason we haven't done this yet is that everyone has a different idea of how to express these rules. I don't want to get into creating DSLs for this. So I'm thinking something like a custom callback.
@ambitious-actor-36781 Can you comment on that ticket with thoughts on how you'd like it to work?
1
a
ah yes can do
f
That just came up in a discussion about repo organization for me yesturday. I was planning on building some custom CI checks that look at pants dependencies output for allowed or disallowed items. But some kind of build in support in pants would be better
1
I added a brainstorm I had on the topic to the ticket
🙌 1
👍 1