I have a `python_sources` which depends on a bunch...
# general
b
I have a
python_sources
which depends on a bunch of
resources
which are
http_sources
. These resources are quite large. Is it possible to optionally not download the resources or not include them in a downstream
pex_binary
?
b
What’s the expected/desired behaviour when the PEX executes that code? If the resources aren’t included, they won’t be able to access it and the code may fail?
b
The resources are needed for a specific operation mode in the library. Without them, the other modes will run fine, which is all what we need in this case.
b
Ah okay. I think there’s a few options for this: • exclude the resource (transitive) dependency from the pex binary using
!
or
!!
. https://www.pantsbuild.org/docs/targets “ignore dependencies with ! and !!” has some more details • Change the library file structure (eg split the files) so the resources are imported by a file/module that isn’t used by the pex binary I guess the first one might be what you’re looking for?
b
You can also switch the target type to
file
. Then they won't be embedded in your binary