Is there a way to have a single resource file shar...
# general
b
Is there a way to have a single resource file shared between multiple distributions without having to create a resource (with specific name) for each of the distributions? [10:08 AM] we have a structure where we are using share code and have a top level BUILD which pulls in the specific needs for the wheel file. It looks like thus:
Copy code
BUILD
    /model_files
    /server1
    /server2
Where the server1 and server2 packages are only
src
targets and
model_files
contains the singular resource we want to share.
1
b
@happy-kitchen-89482 do you happen to know the answer to this?
h
We purposely don't support this (at least when generating setup.py for you). Sharing source/resource files across multiple distributions can cause all sorts of problems unless you are absolutely certain that server1 and server2 will never be installed in the same virtualenv.
You could write a small plugin to augment the generated setup.py appropriately.
But the recommended approach would be for model_files to have its own distribution that the others depend on.
In fact, Pants will infer that distribution-level dep for you, from the inferred file-level deps.
b
yeah, I ended up creating different resource targets for each of the services consuming it.
thanks for the follow up 🙂