我浏览了许多Python项目,但找不到像cake文件一样简单的项目。我正在寻找一个Python等价物,它可以让我:
- 将构建命令保存在项目根目录下的一个单独文件中
- 将每个任务定义为一个简单的函数,并提供描述,当“make”文件在没有参数的情况下运行时,会自动显示这些描述
- 导入我的Python模块
我希望能得到如下的效果:
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()
我已经搜索了很多次,但没有找到类似的内容。如果不存在,我会自己制作,并可能用它来回答这个问题。
感谢您的帮助!