Craft

Like Makefile, but in Python
Download

Craft Ranking & Summary

Advertisement

  • Rating:
  • License:
  • MIT/X Consortium Lic...
  • Price:
  • FREE
  • Publisher Name:
  • Jamie Paton
  • Publisher web site:
  • https://github.com/jdpaton/

Craft Tags


Craft Description

Craft is a tool like Makefile, except everything is in native Python.Installpip install craftCraft works on Python 2.7+ and Python 3.2+.Crafty filesCraft will read attempt to read crafty.py in the current directory or the environment variable $CRAFTFILE.An example crafty.py:from craft import task, depends@task@depends('bar', 'foo')def cake(): """ Prints cake, and depends on foo & bar to run first """ print('Time for cake')@taskdef bar(): """ Prints bar """ print('bar')@taskdef foo(): print("Hi,I'm foo")@taskdef auto(): """ I will run when you supply no arguments to "craft". """ print("Auto - Doing my own thing. Which is 'foo' today.") foo()@taskdef setup(): """ I will run once on any call to "craft" """ print("Hello good sir, I'm the setup routine.")UsageRunning craft -h in the directory containing crafty.py will show the list of available tasks. Example:usage: craft ]positional arguments: taskoptional arguments: -h, --help show this help message and exitAvailable tasks:- cake: Prints cake, and depends on foo & bar to run first- auto: I will run when you supply no arguments to "craft".- setup: I will run once on any call to "craft"- foo:- bar: Prints barAs you can see, the docstring for each @task function will then be represented in the help output, and docstrings can be omitted.You can call individual tasks like:craft fooand run multiple tasks with one call like:craft foo barProduct's homepage


Craft Related Software