Developer Guide

Dependencies

You will need to install the core BoboCEP requirements from both requirements.txt and its additional development requirements from requirements-dev.txt. For example:

pip install -r requirements.txt
pip install -r requirements-dev.txt

Development Tools

BoboCEP uses GitHub Actions for Continuous Integration (CI) and Continuous Deployment (CD). It uses two YAML scripts to trigger the respective action workflows, namely:

  1. .github/workflows/cicd.yml for CI/CD tasks, including: linting, type checking, code coverage, documentation coverage, and deployment to PyPI.

  2. .github/workflows/security.yml for security checks.

These scripts are triggered on a push to the main branch. The security script also runs periodically.

It is recommended that you run the individual CI/CD tasks manually before committing. These are discussed next.

Code Linting

flake8 is used for code linting. Run the following two commands to lint BoboCEP and its test suite, respectively.

flake8 ./bobocep --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 ./tests --count --select=E9,F63,F7,F82 --show-source --statistics

Code Testing and Coverage

coverage is used for code testing and coverage. Results are uploaded to Code Climate. Run the following command to test BoboCEP.

coverage run -m pytest tests

The coverage configuration can be found in .coveragerc. GitHub Actions additionally enforces a minimum coverage of 98%. You can check that this requirement has been satisfied using the following.

coverage report --fail-under=98

You can locally inspect the code coverage with an HTML output by running the following.

coverage html

Documentation

Documentation is built using sphinx and is deployed via Read the Docs. You can compile documentation locally via the following.

cd docs
make html

Or, for Windows (PowerShell).

cd docs
.\make.bat html

Documentation Coverage

interrogate is used for testing and code coverage. Run the following command to check BoboCEP documentation coverage. It requires a minimum documentation coverage of 100%.

interrogate -vv bobocep --fail-under 100

Type Checking

mypy is used for type checking. Run the following two commands to check BoboCEP and its test suite, respectively.

mypy ./bobocep
mypy ./tests

Versioning

BoboCEP uses Semantic Versioning and the bump2version tool for editing the software version. See here for more information. The major, minor, or patch components of the version number can be changed with the following:

bump2version patch