https://pantsbuild.org/ logo
a

ambitious-actor-36781

11/23/2021, 6:27 AM
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

happy-kitchen-89482

11/23/2021, 6:39 AM
Sounds like what you want is a way to enforce dependency rules? E.g., saying "this thing may not depend on this thing"?
a

ambitious-actor-36781

11/23/2021, 6:44 AM
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

curved-television-6568

11/23/2021, 7:44 AM
a

ambitious-actor-36781

11/23/2021, 7:52 AM
yeah.
h

happy-kitchen-89482

11/23/2021, 7:38 PM
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

ambitious-actor-36781

11/23/2021, 7:39 PM
ah yes can do
f

freezing-vegetable-92896

11/24/2021, 6:24 PM
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
4 Views