vulcan-builder


Namevulcan-builder JSON
Version 0.2.3 PyPI version JSON
download
home_pagehttps://code.exrny.com/opensource/vulcan-builder/
SummaryLightweight Python Build Tool.
upload_time2023-02-10 18:32:21
maintainer
docs_urlNone
authorPeter Salnikov
requires_python
licenseMIT License
keywords devops build tool
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            |Build Status|

Vulcan Builder
==============

This project is a fork of Pynt by `Raghunandan
Rao <https://github.com/rags/pynt>`__. 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

.. code:: bash

   $ pip install vulcan-builder

Using easy_install

.. code:: bash

   $ 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**
------------

.. code:: python


   #!/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.

.. code:: bash

   $ 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'

.. code:: bash

   $ 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).

.. code:: bash

   $ 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.

.. code:: bash

   $ 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.

.. code:: bash

   $ 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.

.. code:: bash

   $ 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.

.. code:: python

   from deploy_tasks import *
   from test_tasks import functional_tests, report_coverage

Contributors/Contributing
-------------------------

-  Raghunandan Rao - vulcan-builder is preceded by and forked from
   `pynt <https://github.com/rags/pynt>`__, which was created by
   `Raghunandan Rao <https://github.com/rags/pynt>`__.
-  Calum J. Eadie - pynt is preceded by and forked from
   `microbuild <https://github.com/CalumJEadie/microbuild>`__, which was
   created by `Calum J. Eadie <https://github.com/CalumJEadie>`__.

If you want to make changes the repo is at
https://github.com/exrny/vulcan-builder. You will need
`pytest <http://www.pytest.org>`__ to run the tests

.. code:: bash

   $ ./vb t

It will be great if you can raise a `pull
request <https://help.github.com/articles/using-pull-requests>`__ once
you are done.

If you find any bugs or need new features please raise a ticket in the
`issues section <https://github.com/exrny/vulcan-builder/issues>`__ of
the github repo.

License
-------

vulcan-builder is licensed under a `MIT
license <http://opensource.org/licenses/MIT>`__

.. |Build Status| image:: https://travis-ci.org/exrny/vulcan-builder.png?branch=master
   :target: https://travis-ci.org/exrny/vulcan-builder

Changes
=======

0.1.0 - 04/02/2018
------------------

-  Initial commit

            

Raw data

            {
    "_id": null,
    "home_page": "https://code.exrny.com/opensource/vulcan-builder/",
    "name": "vulcan-builder",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "devops,build tool",
    "author": "Peter Salnikov",
    "author_email": "opensource@exrny.com",
    "download_url": "https://files.pythonhosted.org/packages/73/8f/1e013645852e1f0ca1748604fd54328bec0a08ab12a1910ae7c435b9f644/vulcan-builder-0.2.3.tar.gz",
    "platform": null,
    "description": "|Build Status|\n\nVulcan Builder\n==============\n\nThis project is a fork of Pynt by `Raghunandan\nRao <https://github.com/rags/pynt>`__. We will contribute changes to the\noriginal rags/pynt repo.\n\nVulcan Builder supports EXR\u2019s applications via a lightweight, concise\nPython DevOps tool. We will develop our own improvements on the initial\nrags/pynt repo here and publish improvements to the original repo.\n\nThis is an EXR Open Source project.\n\nA pynt of Python build.\n=======================\n\nFeatures\n--------\n\n-  Easy to learn.\n-  Build tasks are just python funtions.\n-  Manages dependencies between tasks.\n-  Automatically generates a command line interface.\n-  Rake style param passing to tasks\n-  Supports python 2.7 and python 3.x\n-  Async tasks\n\nTodo Features\n-------------\n\n-  Additional tasks timing reporting\n-  Debug mode\n\nInstallation\n------------\n\nYou can install vulcan-builder from the Python Package Index (PyPI) or\nfrom source.\n\nUsing pip\n\n.. code:: bash\n\n   $ pip install vulcan-builder\n\nUsing easy_install\n\n.. code:: bash\n\n   $ easy_install vulcan-builder\n\nExample\n-------\n\nThe build script is written in pure Python and vulcan-builder takes care\nof managing any dependencies between tasks and generating a command line\ninterface.\n\nWriting build tasks is really simple, all you need to know is the @task\ndecorator. Tasks are just regular Python functions marked with the\n``@task()`` decorator. Dependencies are specified with ``@task()`` too.\nTasks can be ignored with the ``@task(ignore=True)``. Disabling a task\nis an useful feature to have in situations where you have one task that\na lot of other tasks depend on and you want to quickly remove it from\nthe dependency chains of all the dependent tasks.\n\n**build.py**\n------------\n\n.. code:: python\n\n\n   #!/usr/bin/python\n\n   import sys\n   from vulcan.builder import task\n\n   @task()\n   def clean():\n       '''Clean build directory.'''\n       print 'Cleaning build directory...'\n\n   @task(clean)\n   def html(target='.'):\n       '''Generate HTML.'''\n       print 'Generating HTML in directory \"%s\"' %  target\n\n   @task(clean, ignore=True)\n   def images():\n       '''Prepare images.'''\n       print 'Preparing images...'\n\n   @task(html,images)\n   def start_server(server='localhost', port = '80'):\n       '''Start the server'''\n       print 'Starting server at %s:%s' % (server, port)\n\n   @task(start_server) #Depends on task with all optional params\n   def stop_server():\n       print 'Stopping server....'\n\n   @task()\n   def copy_file(src, dest):\n       print 'Copying from %s to %s' % (src, dest)\n\n   @task()\n   def echo(*args,**kwargs):\n       print args\n       print kwargs\n       \n   # Default task (if specified) is run when no task is specified in the command line\n   # make sure you define the variable __DEFAULT__ after the task is defined\n   # A good convention is to define it at the end of the module\n   # __DEFAULT__ is an optional member\n\n   __DEFAULT__=start_server\n\n**Running vulcan-builder tasks**\n--------------------------------\n\nThe command line interface and help is automatically generated. Task\ndescriptions are extracted from function docstrings.\n\n.. code:: bash\n\n   $ vb -h\n   usage: vb [-h] [-l] [-v] [-f file] [task [task ...]]\n\n   positional arguments:\n     task                  perform specified task and all its dependencies\n\n   optional arguments:\n     -h, --help            show this help message and exit\n     -l, --list-tasks      List the tasks\n     -v, --version         Display the version information\n     -f file, --file file  Build file to read the tasks from. Default is\n                           'build.py'\n\n.. code:: bash\n\n   $ vb -l\n   Tasks in build file ./build.py:\n     clean                       Clean build directory.\n     copy_file                   \n     echo                        \n     html                        Generate HTML.\n     images           [Ignored]  Prepare images.\n     start_server     [Default]  Start the server\n     stop_server                 \n\n   Powered by vulcan-builder - A Lightweight Python Build Tool.\n\nvulcan-builder takes care of dependencies between tasks. In the\nfollowing case start_server depends on clean, html and image generation\n(image task is ignored).\n\n.. code:: bash\n\n   $ vb #Runs the default task start_server. It does exactly what \"vb start_server\" would do.\n   [ example.py - Starting task \"clean\" ]\n   Cleaning build directory...\n   [ example.py - Completed task \"clean\" ]\n   [ example.py - Starting task \"html\" ]\n   Generating HTML in directory \".\"\n   [ example.py - Completed task \"html\" ]\n   [ example.py - Ignoring task \"images\" ]\n   [ example.py - Starting task \"start_server\" ]\n   Starting server at localhost:80\n   [ example.py - Completed task \"start_server\" ]\n\nThe first few characters of the task name is enough to execute the task,\nas long as the partial name is unambigious. You can specify multiple\ntasks to run in the commandline. Again the dependencies are taken taken\ncare of.\n\n.. code:: bash\n\n   $ vb cle ht cl\n   [ example.py - Starting task \"clean\" ]\n   Cleaning build directory...\n   [ example.py - Completed task \"clean\" ]\n   [ example.py - Starting task \"html\" ]\n   Generating HTML in directory \".\"\n   [ example.py - Completed task \"html\" ]\n   [ example.py - Starting task \"clean\" ]\n   Cleaning build directory...\n   [ example.py - Completed task \"clean\" ]\n\nThe \u2018html\u2019 task dependency \u2018clean\u2019 is run only once. But clean can be\nexplicitly run again later.\n\nvb tasks can accept parameters from commandline.\n\n.. code:: bash\n\n   $ vb \"copy_file[/path/to/foo, path_to_bar]\"\n   [ example.py - Starting task \"clean\" ]\n   Cleaning build directory...\n   [ example.py - Completed task \"clean\" ]\n   [ example.py - Starting task \"copy_file\" ]\n   Copying from /path/to/foo to path_to_bar\n   [ example.py - Completed task \"copy_file\" ]\n\nvb can also accept keyword arguments.\n\n.. code:: bash\n\n   $ vb start[port=8888]\n   [ example.py - Starting task \"clean\" ]\n   Cleaning build directory...\n   [ example.py - Completed task \"clean\" ]\n   [ example.py - Starting task \"html\" ]\n   Generating HTML in directory \".\"\n   [ example.py - Completed task \"html\" ]\n   [ example.py - Ignoring task \"images\" ]\n   [ example.py - Starting task \"start_server\" ]\n   Starting server at localhost:8888\n   [ example.py - Completed task \"start_server\" ]\n       \n   $ vb echo[hello,world,foo=bar,blah=123]\n   [ example.py - Starting task \"echo\" ]\n   ('hello', 'world')\n   {'blah': '123', 'foo': 'bar'}\n   [ example.py - Completed task \"echo\" ]\n\n**Organizing build scripts**\n----------------------------\n\nYou can break up your build files into modules and simple import them\ninto your main build file.\n\n.. code:: python\n\n   from deploy_tasks import *\n   from test_tasks import functional_tests, report_coverage\n\nContributors/Contributing\n-------------------------\n\n-  Raghunandan Rao - vulcan-builder is preceded by and forked from\n   `pynt <https://github.com/rags/pynt>`__, which was created by\n   `Raghunandan Rao <https://github.com/rags/pynt>`__.\n-  Calum J. Eadie - pynt is preceded by and forked from\n   `microbuild <https://github.com/CalumJEadie/microbuild>`__, which was\n   created by `Calum J. Eadie <https://github.com/CalumJEadie>`__.\n\nIf you want to make changes the repo is at\nhttps://github.com/exrny/vulcan-builder. You will need\n`pytest <http://www.pytest.org>`__ to run the tests\n\n.. code:: bash\n\n   $ ./vb t\n\nIt will be great if you can raise a `pull\nrequest <https://help.github.com/articles/using-pull-requests>`__ once\nyou are done.\n\nIf you find any bugs or need new features please raise a ticket in the\n`issues section <https://github.com/exrny/vulcan-builder/issues>`__ of\nthe github repo.\n\nLicense\n-------\n\nvulcan-builder is licensed under a `MIT\nlicense <http://opensource.org/licenses/MIT>`__\n\n.. |Build Status| image:: https://travis-ci.org/exrny/vulcan-builder.png?branch=master\n   :target: https://travis-ci.org/exrny/vulcan-builder\n\nChanges\n=======\n\n0.1.0 - 04/02/2018\n------------------\n\n-  Initial commit\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "Lightweight Python Build Tool.",
    "version": "0.2.3",
    "split_keywords": [
        "devops",
        "build tool"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "738f1e013645852e1f0ca1748604fd54328bec0a08ab12a1910ae7c435b9f644",
                "md5": "a9e8e8f41f1bca93809af3a9b9455106",
                "sha256": "6a451acd2ccc81b6f7aaf6c433d81bf9a2d12159e0bf63df2bfd102b9ea06c4a"
            },
            "downloads": -1,
            "filename": "vulcan-builder-0.2.3.tar.gz",
            "has_sig": false,
            "md5_digest": "a9e8e8f41f1bca93809af3a9b9455106",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 11950,
            "upload_time": "2023-02-10T18:32:21",
            "upload_time_iso_8601": "2023-02-10T18:32:21.016525Z",
            "url": "https://files.pythonhosted.org/packages/73/8f/1e013645852e1f0ca1748604fd54328bec0a08ab12a1910ae7c435b9f644/vulcan-builder-0.2.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-02-10 18:32:21",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "vulcan-builder"
}
        
Elapsed time: 0.05321s