Another question: Assuming a mono-repo with multip...
# general
p
Another question: Assuming a mono-repo with multiple first-party packages that have dependencies between them, is there a way to forbid some dependencies and have pants error out if they are detected? E.g. prohibit library
libA
from depending on application
appX
or so? Since pants resolves the dependencies on the file level, it's not bothered by that (or even by circular dependencies), but the library will pull the app when a user installs it, which is what one wanted to avoid in the first place by splitting the code this way.
1
b
I think what you're looking for is https://github.com/pantsbuild/pants/issues/13393 which I think is in PR (alebit a bit slow on moving 🙂 )
👍 1
p
Thanks, that seems really close to what I had in mind and will probably cover most cases in our codebase. Reading the issue and a couple of linked ones, I also stumbled upon import linter, which would also help a lot. I was about to start parsing the output of
./pants peek ::
and search for forbidden dependencies programmatically, but I think I'll wait for the PR to get merged.
b
Yeah, Ideally the visibility support is cross-language, monorepo-wide, which is why i'm excited it's getting some airtime 😛
The author, @curved-television-6568 recently moved to Canada, so contributions are slower than his usual "scary fast" pace 😛 Feel free to chime in, or chip in if you want ❤️
💨 1
🏃 1
w
so contributions are slower
Because of Canada's awesomeness
🙌 2
🇨🇦 2
🍁 2
p
Feel free to chime in, or chip in if you want ❤️
I'm still not familiar enough with the codebase to chip in my own code, but I looked over the PR and it covers all that I can think of. I'll try to set up a dev environment for pants and try it out on our codebase, just to confirm that it would catch the error that triggered my question.
🙌 1
b
Actually Pants has this already built-in for you: https://www.pantsbuild.org/docs/running-pants-from-sources (to some degree)
p
Yet another nice feature, thanks! :)
🙌 1
b
When you inevitably get addicted to writing interesting plugin code and mucking with the internals, reach out. We're always happy to answer questions, big or small ❤️
💯 1
🙌 1