Package: vulcan-builder
Vulcan BuilderThis project is a fork of Pynt byRaghunandan
Rao. We will contribute changes to the
original rags/pynt repo.Vulcan Builder supports EXR’s applications via a lightweight, concise
Python DevOps tool. We will develop our own improvements on the initial
rags/pynt repo here and publish improvements to the original repo.This is an EXR Open Source project.A pynt of Python build.FeaturesEasy to learn.Build tasks are just python funtions.Manages dependencies between tasks.Automatically generates a command line interface.Rake style param passing to tasksSupports python 2.7 and python 3.xAsync tasksTodo FeaturesAdditional tasks timing reportingDebug modeInstallationYou can install vulcan-builder from the Python Package Index (PyPI) or
from source.Using pip$pipinstallvulcan-builderUsing easy_install$easy_installvulcan-builderExampleThe build script is written in pure Python and vulcan-builder takes care
of managing any dependencies between tasks and generating a command line
interface.Writing build tasks is really simple, all you need to know is the @task
decorator. Tasks are just regular Python functions marked with the@task()decorator. Dependencies are specified with@task()too.
Tasks can be ignored with the@task(ignore=True). Disabling a task
is an useful feature to have in situations where you have one task that
a lot of other tasks depend on and you want to quickly remove it from
the dependency chains of all the dependent tasks.build.py#!/usr/bin/pythonimportsysfromvulcan.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%sto%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_serverRunning vulcan-builder tasksThe command line interface and help is automatically generated. Task
descriptions are extracted from function docstrings.$vb-husage:vb[-h][-l][-v][-ffile][task[task...]]positionalarguments:taskperformspecifiedtaskandallitsdependenciesoptionalarguments:-h,--helpshowthishelpmessageandexit-l,--list-tasksListthetasks-v,--versionDisplaytheversioninformation-ffile,--filefileBuildfiletoreadthetasksfrom.Defaultis'build.py'$vb-lTasksinbuildfile./build.py:cleanCleanbuilddirectory.copy_fileechohtmlGenerateHTML.images[Ignored]Prepareimages.start_server[Default]Starttheserverstop_serverPoweredbyvulcan-builder-ALightweightPythonBuildTool.vulcan-builder takes care of dependencies between tasks. In the
following case start_server depends on clean, html and image generation
(image task is ignored).$vb#Runs the default task start_server. It does exactly what "vb start_server" would do.[example.py-Startingtask"clean"]Cleaningbuilddirectory...[example.py-Completedtask"clean"][example.py-Startingtask"html"]GeneratingHTMLindirectory"."[example.py-Completedtask"html"][example.py-Ignoringtask"images"][example.py-Startingtask"start_server"]Startingserveratlocalhost:80[example.py-Completedtask"start_server"]The first few characters of the task name is enough to execute the task,
as long as the partial name is unambigious. You can specify multiple
tasks to run in the commandline. Again the dependencies are taken taken
care of.$vbclehtcl[example.py-Startingtask"clean"]Cleaningbuilddirectory...[example.py-Completedtask"clean"][example.py-Startingtask"html"]GeneratingHTMLindirectory"."[example.py-Completedtask"html"][example.py-Startingtask"clean"]Cleaningbuilddirectory...[example.py-Completedtask"clean"]The ‘html’ task dependency ‘clean’ is run only once. But clean can be
explicitly run again later.vb tasks can accept parameters from commandline.$vb"copy_file[/path/to/foo, path_to_bar]"[example.py-Startingtask"clean"]Cleaningbuilddirectory...[example.py-Completedtask"clean"][example.py-Startingtask"copy_file"]Copyingfrom/path/to/footopath_to_bar[example.py-Completedtask"copy_file"]vb can also accept keyword arguments.$vbstart[port=8888][example.py-Startingtask"clean"]Cleaningbuilddirectory...[example.py-Completedtask"clean"][example.py-Startingtask"html"]GeneratingHTMLindirectory"."[example.py-Completedtask"html"][example.py-Ignoringtask"images"][example.py-Startingtask"start_server"]Startingserveratlocalhost:8888[example.py-Completedtask"start_server"]$vbecho[hello,world,foo=bar,blah=123][example.py-Startingtask"echo"]('hello','world'){'blah':'123','foo':'bar'}[example.py-Completedtask"echo"]Organizing build scriptsYou can break up your build files into modules and simple import them
into your main build file.fromdeploy_tasksimport*fromtest_tasksimportfunctional_tests,report_coverageContributors/ContributingRaghunandan Rao - vulcan-builder is preceded by and forked frompynt, which was created byRaghunandan Rao.Calum J. Eadie - pynt is preceded by and forked frommicrobuild, which was
created byCalum J. Eadie.If you want to make changes the repo is athttps://github.com/exrny/vulcan-builder. You will needpytestto run the tests$./vbtIt will be great if you can raise apull
requestonce
you are done.If you find any bugs or need new features please raise a ticket in theissues sectionof
the github repo.Licensevulcan-builder is licensed under aMIT
licenseChanges0.1.0 - 04/02/2018Initial commit