轻量级python构建工具
navio-builder的Python项目详细描述
为什么我要做这个叉子,这里会发生什么?
这个项目是由Pynt提供的。Raghunandan Rao
我欣赏Raghunandan Rao的作品 并将我的更改的任何部分推到初始 rags/pynt回购。
这个navio builder项目的目的是为我的客户提供 轻量级且易于使用的python devops工具。我要积累 由Raghunandan Rao和其他人完成的工作 这里是Pynt出资人。我自己的变化和新功能 在这里实现并作为pr推送到原始pynt repo。
python构建的pynt。
功能
- 易学。
- 构建任务只是python的功能。
- 管理任务之间的依赖关系。
- 自动生成命令行界面。
- rake样式的参数传递给任务
- 支持Python2.7和Python3.x
TOdo功能
- 异步任务
- 其他任务计时报告
安装
可以从python包索引(pypi)或 从源头上。
使用pip
$ pip install navio-builder
使用简易安装
$ easy_install navio-builder
示例
构建脚本是用纯python编写的,navio builder负责 管理任务之间的任何依赖关系并生成命令行 接口。
编写构建任务非常简单,您只需要知道@task 装饰工。任务只是用 @task()装饰器。依赖项也用@task()指定。 可以使用@task(ignore=True)忽略任务。禁用任务 是一个有用的特性,可以在您有一个任务 许多其他任务都依赖于,您希望快速将其从 所有依赖任务的依赖链。
build.py
#!/usr/bin/pythonimportsysfromnavio.builderimporttask@task()defclean():'''Clean build directory.'''print'Cleaning build directory...'@task(clean)defhtml(target='.'):'''Generate HTML.'''print'Generating HTML in directory "%s"'%target@task(clean,ignore=True)defimages():'''Prepare images.'''print'Preparing images...'@task(html,images)defstart_server(server='localhost',port='80'):'''Start the server'''print'Starting server at %s:%s'%(server,port)@task(start_server)#Depends on task with all optional paramsdefstop_server():print'Stopping server....'@task()defcopy_file(src,dest):print'Copying from %s to %s'%(src,dest)@task()defecho(*args,**kwargs):printargsprintkwargs# Default task (if specified) is run when no task is specified in the command line# make sure you define the variable __DEFAULT__ after the task is defined# A good convention is to define it at the end of the module# __DEFAULT__ is an optional member__DEFAULT__=start_server
组织生成脚本
您可以将构建文件分解为模块并简单地导入它们 在主生成文件中。
fromdeploy_tasksimport*fromtest_tasksimportfunctional_tests,report_coverage
贡献者/贡献者
- raghunandan rao-navio builder前面是 pynt,它是由 Raghunandan Rao。
- calum j.eadie-pynt前面是 microbuild,这是 由Calum J. Eadie创建。
如果您想进行更改,回购协议位于 https://github.com/naviotech/navio-builder。你需要 pytest运行测试
$ ./b t
如果你能提高一次pull request那就太好了 你完了。
如果您发现任何错误或需要新功能,请在 issues section Github回购协议。
许可证
navio builder是根据MIT license
更改
0.1.16-14/12/2017
- 将任务运行时间添加到输出
0.1.0-11/12/2017
- 初次发布。派特的叉子。
- 将“完成”重命名为模块