/monitoring-lib-python

Define context, resource and summary classes, use nagiosplugin python lib

Primary LanguagePython

monitoring-lib-python

https://travis-ci.org/Temelio/monitoring-lib-python.svg?branch=master

Temelio monitoring lib written in Python, used with Shinken.

Dependencies

Dependencies are managed by Pip, so thanks to follow its documentation and install it.

You should use virtualenv when you work to your project, because you'll have a dedicated and clean environment for your project.

Just a warning about virtualenv, if you have error on python3 virtualenv create, update the virtualenv package:

$ pip install virtualenv --user --upgrade

Virtualenv management

  • Using virtualenv:

    $ virtualenv ./ && source ./bin/activate
    
  • Using pew:

    $ pew new temelio_monitoring
    

Install dependencies

  • With dev dependencies:

    $ pip install -r requirements_dev.txt
    
  • Without dev dependencies:

    $ pip install -r requirements.txt
    

Testing

Tests are automatically runned by Travis when you push or submit a merge request but you must run them before push your changes to GitHub !

Run linter

This test check syntax error and pip8 rules:

$ make lint

Run unit tests and code coverage

  • For default python version:

    $ make test
    
  • For all mnaged python version:

    $ make test-all
    

Documentation

The documentation is self generated from code comments, following the RST syntax and is built with Sphynx. Take time to read their documentation.

In fact, no comment = no documentation = Merge request refused !.

Generate the documentation

Build documentation using RST files and doctrings:

$ make docs

You will find the generated documentation into build/doc folder.