Hey guys, new to Pants and was just looking around...
# general
q
Hey guys, new to Pants and was just looking around to see if solves some of my pain points with Python projects. 1. My repositories start out simple but then quickly end up being multiple “projects” in one - a Python package, CLI apps, a package for REST APIs, a folder with notebooks showing examples, CI/CD scripts, something to containerize, etc. Some of these depend on the Python package while others might not. 2. Sometimes we end up adding another python package project to the same repo because it is “functionally” related but it might need a different execution environment with different version of dependencies. 3. I have tried managing things in different repos but I dont think it makes it easy to do fast development lifecycles because one change ends up being change in one place and then followed by publishing to our internal nexus and then a version update of the dependency somewhere else. I am looking for examples how people manage such repositories - a “monorepo” of different Python projects, where each project may or may not require different environments, and some projects acting as dependencies to others, etc. So far I have “solved” for it using custom stuff but I feel like this should be a common problem which should be already solved and I should not reinvent the wheel here. Will Pants help me solve such use cases or should I look elsewhere?
l
The only one I’ve not personally done is notebooks (assuming you mean jupyter notebooks). It sounds to me like Pants would likely be a good fit for you, we use it here for polyglot/kitchen-sink type repos which might publish multiple python packages, docker images (which may/may not depend on those python packages), Go binaries, etc.
The example Python repo has a couple interdependent projects: https://github.com/pantsbuild/example-python/ and probably the multiple lockfiles/resolves would be useful for you with different projects requiring different versions of the same dependency: https://www.pantsbuild.org/docs/python-lockfiles#multiple-lockfiles
q
Nice! I think the multiple lockfiles provision will come in handy.
b
I can’t speak to all of the things in your examples, but I adopted Pants largely for #3 - it was really painful to maintain dependencies between internal services/libraries without setting up a monorepo and Pants has made that process so much easier. #1 is also something we deal with quite frequently as we have many projects in a single repo; we used to have 5-6 different repos internally for all these different projects and moving to 1 made things so much easier!
q
this sounds really promising! if any of this is open source I’d like to peek in 🙂