Rails uses Rake in lots of neat ways. “rake test,” “rake stats,” “rake db:test:clone_structure” are three little examples that I use constantly when I’m working on a Rails project. For whatever reason, I never considered writing my own tasks, until I started looking at Marcel Molina’s excellent Rakefile in his Amazon S3 library.
I end up writing a handful of little scripts to do common chores when I’m working on a project, I’d never thought to wrap them all up in a nice Rakefile. It would be a great tool to have in Python as well. Granted, you could just write a Rakefile and use it in a Python project. There’s nothing wrong with that (in my humble opinion). Lots of people (including me) use Capistrano for deployment, regardless of the base language of the project. The right tool for the job, right? Right.
That said, for something like “a bunch of little tasks,” it would be nice to keep them in the language you’re working on at the time, so there’s less context switching on the project, right? (I guess…I’m still sort of torn on that, I don’t know if it really makes a big difference or not.) A few ChiPy’s ago, I was talking to Ian about this exact issue, “why doesn’t Python have a good rake equivalent?” He suggested I check out distutils, I did, and didn’t like it much. Over the weekend, he wrote up a good blog entry on the topic, and it seems pretty convincing.
So, in short, I’m going to give it a shot. The next time I need to write up some sort of scripty-buildy-thing on a Python flavored project, I’ll try writing it as a distutils function. I encourage you to try it too. If you need any convincing why this is a worthwhile thing, I strongly encourage you to take a long look at Marcel’s Rakefile, that thing has “develop quick and clean” written all over it.