Been assisting the largest PR of my life the last ...
# random
h
Been assisting the largest PR of my life the last few weeks Got pants up and running across 380+ pypi packages in a monorepo 🚀 https://github.com/run-llama/llama_index/pull/10537
🤯 8
🎉 3
b
7 digits in the diff stat!
💥 4
h
We had a lot of integrations to package 😅
f
This looks really interesting! It will be interesting to see how Pants performs on this. Having more open source Pants projects is really useful in this regard as it gives us better visibility into challenges developers have
1
h
@flat-zoo-31952 so far performance is pretty good! I think once this merges, I can enable the diff compared to main, which should reduce the number of tests being run by a ton. The remote caching is a must for this many packages (and works well with bazel-remote) A few things that I still haven't got working • Mypy (it tries to build a single env for the entire monorepo, which will never work in this setup) • Ruff and black (just need to take the time to setup the proper versions and configs) • I wish pants integrated with pre-commit, since we have an extensive setup there. I wonder if I can write my own plug-in for this
h
A pre-commit plugin would probably be useful to many
💯 1
I assume that by that I mean a plugin using the pre-commit API to integrate Pants, not a plugin using the Pants API to integrate pre-commit? I dunno how pre-commit works really
f
The simplest way I'd see pre-commit integrating is to just put all relevant pants commands in a single invocation
something like ...
Copy code
- id: pants-checks
      name: "Run pants-enabled checks"
      entry: pants lint check test
      language: system
      stages: [commit,push]
      pass_filenames: true
h
Oh, I actually was thinking the other way around haha Since pants is good at multiprocessing stuff, adding a goal like
pants pre-commit
or similar would let me run my existing pre-commit system on each sub-package But the above would be nice too 🙂
f
in my experience, I find pre-commit the tool doesn't scale well for monorepo use cases, and I have a project on my slate to replace it, but that may be specific to our use cases
👀 1
ah yeah... that's the problem is that the Pants dream of running
pants lint check test
as you checks doesn't scale well if that starts to include too many heavy targets. Doing something like
pants pre-commit
would be cool, but would imply needing to convert all checks to be Pants-friendly, likely via adhoc_tools. It's a lot of bookeeping to get you there
👀 1
p
I’m somewhat jealous… I’ve been working on adding pants to the StackStorm project for a long time, but I have to break it into small-ish reviewable PRs. One giant PR has a distinct appeal over the overhead involved in many tiny PRs.
😅 1
Congratulations on getting pants into that repo! Pretty awesome!
❤️ 1
c
Oh, I actually was thinking the other way around haha
I was hoping to use https://github.com/pantsbuild/pants/pull/20135 to turn may of the "little" pre-commit checks like
fix-byte-order-marker
into things that can be run by pants. Not sure to turn that into a more generalizable or shareable shape though.
👀 1
🚀 1
h
@curved-manchester-66006 this seems super clever! This would go a long way to being able to run pre-commit checks for each of the packages I think