Hi all, I am struggling with isolating dependencie...
# general
a
Hi all, I am struggling with isolating dependencies in python. I have a monorepo, with 2 python apps that have a shared library. App B has dependencies that I do not want to include in A. So both apps will have a pex_binary target, but not all dependecies of B should be included in A. When app A and B are separated completely, then I could manage to do that by having a separate resolve for each app, But once I start with that common library (that is used by A and B) then it start becoming complicated. Or at least I could not get it what I wanted. Is there any example that illustrates this use-case?
e
What exactly do you mean by "not all dependencies of B should be included in A"? Pants will only include in A's pex_binary those files that are imported (transitively) by the entry point script of the pex_binary. So any dependency not imported by A will not be included.
a
hmm, then I did something wrong... both apps currently have the same amount of dependencies, I'll see if I can create a sample-project to illustrate the problem
to others that maybe read this thread, I did not interpreted the documentation https://www.pantsbuild.org/stable/docs/python/overview/third-party-dependencies correctly. I added 1 python_requirement() for the whole project, while the documented clearly stated: > _Each third-party dependency you directly use is modeled by a
python_requirement
target_ So once I made multiple python_requirement entries in a BUILD file in the folder
3rdparty/python
, then the pex-file resulted in only the deps that are used