Python package for parsing a build spec(s) from a config file
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
Brett Langdon 69dafc3e50 Add note on what gets searched for 11 years ago
.gitignore Initial commit 11 years ago
LICENSE Initial commit 11 years ago
MANIFEST.in add setup information 11 years ago
README.md Add note on what gets searched for 11 years ago
SPECIFICATION.md add initial specification document 11 years ago
buildparser.py initial version of buildparser 11 years ago
requirements.txt need pyyaml 11 years ago
setup.cfg add setup information 11 years ago
setup.py add setup information 11 years ago

README.md

BuildParser

A specification and parser for project build configuration.

Setup

pip

pip install buildparser

git

git clone git://github.com/brettlangdon/buildparser.git
cd ./buildparser
python setup.py install

Basic Usage

import buildparser

builds = buildparser.parse("./path/to/project")
for build in builds:
    print build.env
    print build.before_build
    print build.build
    print build.after_build
    print build.after_success
    print build.after_failure

API

Environment(object)

Properties

  • type - string
  • options - mixed

Methods

  • __init__(self, type, options)
  • __repr__(self)
  • as_dict(self)
  • as_json(self)
  • as_yaml(self)

Script(object)

Properties

  • commands - list

Methods

  • __init__(self, commands)
  • __repr__(self)
  • as_dict(self)
  • as_json(self)
  • as_yaml(self)

Build(object)

Properties

  • env - Environment
  • before_build - Script
  • build - Script
  • after_build - Script
  • after_success - Script
  • after_failure - Script

Methods

  • __init__(self, env, before_build, build, after_build, after_success, after_failure)
  • __repr__(self)
  • as_dict(self)
  • as_json(self)
  • as_yaml(self)

UnknownExtensionException(Exception)

parse(directory, name="build")

returns: list

Look for an appropriate name file or directory in the directory directory and parse all possible build configurations found.

parse defaults to looking for the following files:

  • .build.yml
  • .build.yaml
  • .build.json
  • .build.ini
  • .build.cfg

or for the directory .build which contains one or many configuration files (name doesn't have to be "build").

parse_directory(dir_name)

returns: list

Look for all appropriate files inside of dir_name and parse configurations found.

parse_file(file_name)

returns: list

Parse any available build configurations from file_name

parse_yaml(file_name)

returns: list

Parse any available build configurations from file_name as though it was yaml.

parse_json(file_name)

returns: list

Parse any available build configurations from file_name as though it was json.

parse_ini(file_name)

returns: list

Parse any available build configurations from file_name as though it was an ini file.