This is probably easy enough to test out, but mayb...
# general
h
This is probably easy enough to test out, but maybe someone already has a quick answer. Let's say in one repo I want to make a distribution (D1) that includes modules A and B and another distribution (D2) that includes modules B and C. Now, in another repo, I want to depend on both D1 and D2. Does that cause problems given the mutual definition of B or are they isolated in some way?
1
h
If you are using pants to generate your set up files, it does some fancy logic to figure this out for you https://www.pantsbuild.org/docs/python-distributions#mapping-source-files-to-distributions
h
Yeah, I would be. I'm more curious what happens on the repo that's using D1 and D2.
e
Pants refuses to multiple package B. It will error if its amiguous whether D1 owns B or D2 owns it. If that happens, you'll pretty much be forced to define a
python_distributuon
to own B. so you'll get D1->D3 and D2->D3.
👍 1
Those docs say all that of course.
This was a lesson learned and a hard opinion gained after dealing with the JVM jar ecosystem in the early days of Pants. In that ecosystem, re-packaging things you don't own is commonplace and leads to super-mysterious errors at runtime.
h
Got it. Makes a lot of sense.