Is there a Cake equivalent for Python?

Viewed 1496

I've raked through a lot of "make for Python" projects, but I can't find any with the simplicity of a cake file. What I'm looking for is a Python equivalent that will let me:

  1. Keep the build commands in a single file in my project root
  2. Define each task as a simple function with a description that will automatically be displayed when the "make" file is run without arguments
  3. Import my Python modules

I'm picturing something like this:

from pymake import task, main

@task('reset_tables', 'Drop and recreate all MySQL tables')
def reset_tables():
    # ...

@task('build_stylus', 'Build the stylus files to public/css/*')
def build_stylus():
    from myproject import stylus_builder
    # ...

@task('build_cscript', 'Build the coffee-script files to public/js/*')
def build_cscript():
    # ...

@task('build', 'Build everything buildable')
def build():
    build_cscript()
    build_stylus()

# etc...

# Function that parses command line args etc...
main()

I've searched and searched but found nothing like it. If it doesn't exist, I will make it myself and probably answer this question with it.

Thanks for your help!

4 Answers
Related