Development
===========

Getting the source
------------------

The source can be obtained via mercurial from
https://bitbucket.org/gocept/nagiosplugin::

   hg clone https://bitbucket.org/gocept/nagiosplugin

This package supports installation in a virtualenv using zc.buildout.


Creating a build with zc.buildout
---------------------------------

First, create a virtualenv if not already present::

   virtualenv -p python3.2 .

If you want to use Python 2.7, specify this Python version while creating the
virtualenv::

   virtualenv -p python2.7 .

Then launch the usual buildout steps::

   bin/python3.2 bootstrap.py -t
   bin/buildout

If you experience version conflicts with distutils, be sure to use a current
virtualenv version. The library developers use virtualenv 1.8.2.


Running tests
-------------

When the buildout succeeds, run the unit test by invoking::

   bin/test

nagiosplugin also includes support for coverage reports. It aims at 100% test
coverage where possible. The preferred way to get a coverate report is to use ::

   bin/createcoverage

to determine test coverage and open the report in a web browser. Alternatively,
run ::

   bin/coverage run bin/test

to get a purely text-based coverage report.

You may run the supplied examples with the local interpreter::

   bin/py src/nagiosplugin/examples/check_load.py


Documentation
-------------

The documentation uses Sphinx. Build the documentation (buildout should have
been running before to install Sphinx etc.)::

   make -C doc html


How to release
--------------

To make a release, we prefer `zest.releaser`_. To make a release, follow
the standard procedure, which usually boils down to::

   fullrelease

`nagiosplugin` tried to obey the semantic version numbering specification
published on SemVer_ but adapts it a little bit to be `PEP 386`_ compliant.

.. _zest.releaser: http://pypi.python.org/pypi/zest.releaser/
.. _SemVer: http://semver.org/
.. _PEP 386: http://www.python.org/dev/peps/pep-0386/

.. vim: set ft=rst sw=3 sts=3 et:
