To install all requirements for development and testing, you can use the provided requirements file.
$ pip install -e .[tests]
Testing the code¶
py.test for testing. Please ensure that all tests pass
before you submit a pull request.
py.test also runs PEP8 and PyFlakes checks
on every run.
This is how you execute the tests and checks from the repository root directory.
If you want to generate a coverage report, you can use the following command.
$ py.test --cov=omnibus --cov-report=html .
django-omnibus uses Sphinx for documentation. You find all the sources files
To update/generate the html output of the documentation, use the following
command inside the
$ make html
Please make sure that you don’t commit the build files inside
To setup your local environment call
npm install in the projects root. This
downloads all necessary dependencies to run the taskrunner.
Change the code¶
To run the build process you can call the grunt taskrunner using:
This starts validation, testing, building and documention processes
in a row as default task of the taskrunner. The build process creates the
library itself and a minified version of them, using the extention
Generate a documentation¶
The client code is fully documented using JSDoc. To get an overview about the classes and functions generate your own JSDoc running the following command. The generated documentation will open immediately.
$ grunt doc
Validation & testing¶
Before you commit your code changes and offer a pull request run the following tasks via grunt:
$ grunt validate
$ grunt test
The tests are written using Jasmine. The test specs are located at
- To declare a private property, add a leading underscore
_to the properties name, for example:
- To declare a constant, use uppercase letters and underscores like:
THIS_IS_A_CONSTANT = 'value'.