- Developer Guide
This document provides a guide for developers to set up their development environment and contribute to the project.
Steps consists of generic steps that are required only once,
and module-specific steps that are required for each module.
The document also provides information on how to contribute to the project.
The following steps are required only once when setting up the development environment.
sudo apt install make
Note
For up-to-date installation instructions, please refer to official website
curl https://pyenv.run | bash
To get a list of latest Python versions available:
pyenv install --list | grep 3.8
Currently, the latest version is 3.8.20
. To install it:
pyenv install 3.8.20
pip install setuptools
Note
If tox is installed globally, it will be available for all virtual environments.
If it's not installed globally, you will need to install it for each virtual environment.
pip install tox
The following steps are required for each module when setting up the development environment.
Note
Replace collector
with the module's name
pyenv virtualenv collector
Note
Replace collector
with the module's name
pyenv activate collector
After following the setup steps, you can start developing the module. The following commands are available for each module.
The following command will run lint checks, type checking, and tests:
tox
tox -e lint
tox -e type
tox -e py38
Important
When opening a pull request, please provide a signed Contributor Licence Agreement (CLA). More information can be found here.
For each module, run tox
to make sure that the code is linted, typed, and tested.
tox
For each module, make sure that the license headers are up to date using this command:
make license
Please follow the style guide for branch names, PRs, and commit messages as described in the style guide.
Before building a docker image, clean up the project to reduce image size.
tox
command caches a lot of files that might be over 500MB.
make clean
pyenv virtualenvs
An example output:
The *
indicates which virtualenv is active.
3.8.20/envs/collector (created from /home/xrduser/.pyenv/versions/3.8.20)
* collector (created from /home/xrduser/.pyenv/versions/3.8.20)
pyenv deactivate
pyenv virtualenv-delete collector
pyenv versions
pyenv uninstall 3.8.20