All the requirements in order to perform development on the product should be installable in a virtualenv.
$ pip install -r test-requirements.txt
In order to build a release you will also need to install pandoc. On Ubuntu, you should be able to do:
$ sudo apt-get install pandoc
Running the tests is easy with nose (including in test-requirements.txt). From the project root:
$ nosetests .
To run the unit tests with coverage results (view cover/index.html), do the following:
$ nosetests --with-coverage --cover-html --cover-package=devicecloud .
New contributions to the library will only be accepted if they include unit test coverage (with some exceptions).
We also support running the tests against all supported versions of python using a combination of tox and pyenv. To run all of the tests against all supported versions of python, just do the following:
$ ./toxtest.sh
This might take awhile the first time as it will build from source a version of the interpreter for each version supported. If you recieve errors from pyenv, there may be addition dependencies required. Please visit https://github.com/yyuu/pyenv/wiki/Common-build-problems for additional pointers.
Documentation (outside of this file and the README) is done via Sphinx. To build the docs, just do the following (with virtualenv activated):
$ cd docs
$ make html
The docs that are built will be located at docs/_build/html/index.html.
The documentation for the project is published on github using a (Github Pages)[https://pages.github.com/] Project Site. The process for releasing a new set of documentation is the following:
- Create a fresh clone of the project and checkout the
gh-pagesbranch. Although this is the same repo, the tree is completely separate from the main python-devicecloud codebase. - Remove all contents from the working area
- From the python-devicecloud repo,
cp -r docs/_build/html/* /path/to/other/repo/. - Commit and push the update
gh-pagesbranch to github
Each source file should be prefixed with the following header:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Copyright (c) 2014 Etherios, Inc. All rights reserved.
# Etherios, Inc. is a Division of Digi International.