SJ cartoon avatar

Development You Want Me in Your Pants

Me: "Okay, so to deploy, we have to generate the protobufs, cythonize our core libs, embed the protobufs and core libs in some of our sub-repos, Dockerize the API gateway and microservices, package our system services, and then deploy all of that to our server and then run e2e testing."

Client: "Alright, this sounds painful, how do we do it?"

Me: "./pants deploy :myproject" [drops keyboard and walks away]

I'm officially a Pants contributor!

The past month has been a very Pants-heavy one for me. I've been semi-active in the Slack workspace while building out a few plugins, I wrote a tutorial on writing your first Pants plugin, and I just released a post on the Pants blog about the PyOxidizer plugin I wrote.

All of that, plus a bit more, got me named as a Pants contributor a week ago, which is pretty sweet.

As for that quote above, well, I wrote it in an appreciation post to the Pants team and community for all their help with plugin support. For the sake of full transparency, I can't even start to claim that I wrote those plugins on my own, because I had barrelfuls of help from the Pants community. Anyways, shortly afterwards, that appreciation post found its way to the Pants Testimonials page - which is also quite cool, because most of my quotable quotes are usually followed by someone saying "...wait, what?".

Is building and deploying a project really that easy?

Yep. Now it is.

Putting on Pants one leg at a time

I recently migrated several of my Python projects away from... well... nothing (bash scripts) to Pants. During that migration, I re-wrote the build/deployment process for a multi-year legacy project. Mainline Pants alone wasn't enough, even though it covered about 90% of the project's workflow. It natively handled the Protobuf code generation, Dockerizing images, bundling python code into PEXes - but when it came to compiling some components with Cython, bundling my client-side web code, and then deploying my project - I was back to scripts (technically, Pants shell commands).

And then suspenders

That is, until, I wrote a few hacked together plugins for basic npm support, Cython support, and Ansible support. After I wrote and hooked up these plugins, my workflow was *chef's kiss*.

I haven't released these to the public yet, as they're super customized to my workflow - but I am slowly building plugin support (feel free to create an issue for a new, related plugin).

Living that Pantsless Life

It sucks. Don't do it.

By "it" - I mean building a non-trivial Python project without a build system. You certainly can use bash scripts, but once you've migrated to a build system (which only took about two days for ALL of my projects), you won't want to go back.

I'm not gonna hate if you use something like Bazel, Buck, Please, or whatever else. I've flirted with alternatives and decided to go steady with Pants because it solved the right problems at the right time.