This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Parser to extract data from a Vagrantfile into a data struct readable by python

Project Description

pyvagrantfile

Parses a vagrant file into a python object for inspect. Mainly used to read and build Vagrant file in python. I built this to help me write a utility in python which can build projects and convert Vagrantfiles to packer files.

Supported Directives

  • Most vm.config directives,
  • Chef provisioner
  • Shell provisioner
  • VB provider

Installation

After it’s on the pip server, you should be able to install on the client by running

$ pip install pyvagrantfile

Deployment

When this is ready to be deployed, you can upload it to the pip server

$ cd $WORKSPACE/pyvagrantfile
$ python setup.py sdist upload

Usage

Contributing

virtualenv

When doing development and testing, it’s good practice to use a virtualenv. A virtualenv is a sandboxed python environment which does not modify the system python installation You can install one as follows:

$ pip install virtualenv
$ cd $WORKSPACE/pyvagrantfile
$ virtualenv venv
$ . ./venv/bin/activate
(pyvagrantfile)$

Now that you have a working virtualenv, you can install the utility in development mode. Keep in mind that the ‘activate’ step, is valid only for a single session. If you close the terminal you’ll have to run venv/bin/activate again. You can now run pip, python, and pyvagrantfile while only referring to the local python environment created in $WORKSPACE/pyvagrantfile. You can see this by running:

(pyvagrantfile)$ which pip
$WORKSPACE/pyvagrantfile/venv/bin/python
(pyvagrantfile)$ which python

Development Mode

When testing this utility, you can install it and still edit the source files as follows:

$ cd $WORKSPACE/pyvagrantfile
$ pip install --editable .

Roadmap

I intially tried to use pyPEG, but could not get a handle on it, so for now, we use a custom state parser. I want to move this to a PEG parser to make it easier to manage, but in the spirit of minimum viable product, it’s up and out.

  • This is currently way too specific. Needs to be rewritten to parse general ruby structures and extract details out of it, rather than looking for particular vagrant configurations.
  • Port parser from state parser to PEG parser.
Release History

Release History

This version
History Node

0.5.11

History Node

0.5.10

History Node

0.5.9

History Node

0.5.8

History Node

0.5.7

History Node

0.5.6

History Node

0.5.5

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
pyvagrantfile-0.5.11-py2.py3-none-any.whl (9.2 kB) Copy SHA256 Checksum SHA256 2.7 Wheel Oct 20, 2015
pyvagrantfile-0.5.11.tar.gz (7.0 kB) Copy SHA256 Checksum SHA256 Source Oct 20, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting