Hi all, I was wondering if there is a general temp...
# general
p
Hi all, I was wondering if there is a general template on how to organize python monorepo with pants? We think of moving our code from multirepo to monorepo, and I was wondering, where to put the requirement files? Our services (and a common library) share the same versions of libraries like pandas etc. One example I saw https://towardsdatascience.com/building-a-monorepo-for-data-science-with-pantsbuild-2f77b9ee14bd?gi=100b8965994b appears to have only single requirements.txt at the root of the monorepo - is that common? I was thinking it makes sense, since pants figures out what packages are required by individual python modules anyway?
Also, is there a way to inspect if that common requirements.txt file defines dependencies that are not used at all?
b
One reqs file is certainly easier, but not required. https://www.pantsbuild.org/v2.13/docs/python-third-party-dependencies is a good start
Also, is there a way to inspect if that common requirements.txt file defines dependencies that are not used at all?
Yes, but not easily. For each requirement it'll have a Pants "address". Then for each one running
./pants dependees <address>
should yield all the dependees. If there's only one (the Pants target that references them all as one) then it isn't used anywhere 🙂
p
Ok, so https://www.pantsbuild.org/v2.13/docs/python-third-party-dependencies#warning-multiple-versions-of-the-same-dependency basically suggests the solution, I missed that somehow 🙂 Thanks a lot!