Skip to main content

Build Status

Vulcan Builder

This project is a fork of Pynt by Raghunandan 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.

Features

  • Easy to learn.

  • Build tasks are just python funtions.

  • Manages dependencies between tasks.

  • Automatically generates a command line interface.

  • Rake style param passing to tasks

  • Supports python 2.7 and python 3.x

  • Async tasks

Todo Features

  • Additional tasks timing reporting

  • Debug mode

Installation

You can install vulcan-builder from the Python Package Index (PyPI) or from source.

Using pip

$ pip install vulcan-builder

Using easy_install

$ easy_install vulcan-builder

Example

The 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/python

import sys
from vulcan.builder import task

@task()
def clean():
    '''Clean build directory.'''
    print 'Cleaning build directory...'

@task(clean)
def html(target='.'):
    '''Generate HTML.'''
    print 'Generating HTML in directory "%s"' %  target

@task(clean, ignore=True)
def images():
    '''Prepare images.'''
    print 'Preparing images...'

@task(html,images)
def start_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 params
def stop_server():
    print 'Stopping server....'

@task()
def copy_file(src, dest):
    print 'Copying from %s to %s' % (src, dest)

@task()
def echo(*args,**kwargs):
    print args
    print kwargs

# 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

Running vulcan-builder tasks

The command line interface and help is automatically generated. Task descriptions are extracted from function docstrings.

$ vb -h
usage: vb [-h] [-l] [-v] [-f file] [task [task ...]]

positional arguments:
  task                  perform specified task and all its dependencies

optional arguments:
  -h, --help            show this help message and exit
  -l, --list-tasks      List the tasks
  -v, --version         Display the version information
  -f file, --file file  Build file to read the tasks from. Default is
                        'build.py'
$ vb -l
Tasks in build file ./build.py:
  clean                       Clean build directory.
  copy_file
  echo
  html                        Generate HTML.
  images           [Ignored]  Prepare images.
  start_server     [Default]  Start the server
  stop_server

Powered by vulcan-builder - A Lightweight Python Build Tool.

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 - Starting task "clean" ]
Cleaning build directory...
[ example.py - Completed task "clean" ]
[ example.py - Starting task "html" ]
Generating HTML in directory "."
[ example.py - Completed task "html" ]
[ example.py - Ignoring task "images" ]
[ example.py - Starting task "start_server" ]
Starting server at localhost:80
[ example.py - Completed task "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.

$ vb cle ht cl
[ example.py - Starting task "clean" ]
Cleaning build directory...
[ example.py - Completed task "clean" ]
[ example.py - Starting task "html" ]
Generating HTML in directory "."
[ example.py - Completed task "html" ]
[ example.py - Starting task "clean" ]
Cleaning build directory...
[ example.py - Completed task "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 - Starting task "clean" ]
Cleaning build directory...
[ example.py - Completed task "clean" ]
[ example.py - Starting task "copy_file" ]
Copying from /path/to/foo to path_to_bar
[ example.py - Completed task "copy_file" ]

vb can also accept keyword arguments.

$ vb start[port=8888]
[ example.py - Starting task "clean" ]
Cleaning build directory...
[ example.py - Completed task "clean" ]
[ example.py - Starting task "html" ]
Generating HTML in directory "."
[ example.py - Completed task "html" ]
[ example.py - Ignoring task "images" ]
[ example.py - Starting task "start_server" ]
Starting server at localhost:8888
[ example.py - Completed task "start_server" ]

$ vb echo[hello,world,foo=bar,blah=123]
[ example.py - Starting task "echo" ]
('hello', 'world')
{'blah': '123', 'foo': 'bar'}
[ example.py - Completed task "echo" ]

Organizing build scripts

You can break up your build files into modules and simple import them into your main build file.

from deploy_tasks import *
from test_tasks import functional_tests, report_coverage

Contributors/Contributing

If you want to make changes the repo is at https://github.com/exrny/vulcan-builder. You will need pytest to run the tests

$ ./vb t

It will be great if you can raise a pull request once you are done.

If you find any bugs or need new features please raise a ticket in the issues section of the github repo.

License

vulcan-builder is licensed under a MIT license

Changes

0.2.4 - 12/09/2026

  • Load build files through importlib, as imp is gone in Python 3.12

0.1.0 - 04/02/2018

  • Initial commit

Release files for vulcan-builder 0.2.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vulcan-builder 0.2.4
File Size Uploaded
vulcan_builder-0.2.4.tar.gz 12.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for vulcan-builder 0.2.4
File Interpreter ABI Platform
vulcan_builder-0.2.4-py3-none-any.whl Python 3 none any Details

Total release size: 23.8 kB

Release files / vulcan_builder-0.2.4.tar.gz

Download URL vulcan_builder-0.2.4.tar.gz
Size 12.7 kB
Tags Source
SHA-256 checksum
How to use checksums
97e695a1cb2ad6cb3e0d9baa6ef195bb490f6f09e1edab078b99632cea6badce
BLAKE2b-256 checksum
How to use checksums
0e8705d7b5179d209e80f60b55595ced519776fe3592f078902e2db192f0e200
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Release files / vulcan_builder-0.2.4-py3-none-any.whl

Download URL vulcan_builder-0.2.4-py3-none-any.whl
Size 11.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
32bf92d411af96b187f724edb5425cd8889b289213417fe5ec666bd4ba03fd5d
BLAKE2b-256 checksum
How to use checksums
a86fe7e75d86203e070288aedd0b75465efcc37e556486e873c0688eabe5ee48
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Release history Release notifications | RSS feed

This release

0.2.4 This release

2 release files

0.2.3

1 release file

0.2.2

1 release file

0.2.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page