To make contributions to this charm, you'll need a working development setup.
You can create an environment for development with tox:
tox devenv -e integration
source venv/bin/activateThe repository contains the charm code in the charm directory and the code for the workload
in the root directory. The charm directory has been built using the
paas-charm approach and then modified to support
the specific actions of this charm.
This project uses tox for managing test environments. There are some pre-configured environments
that can be used for linting and formatting code when you're preparing contributions to the charm:
tox run -e fmt # update your code according to linting rules
tox run -e lint # code style
tox run -e unit # unit tests
tox run -e integration # integration tests
tox # runs 'fmt', 'lint', and 'unit' environmentsThe integration tests require additional parameters which can be looked up in the tests/conftest.py file.
Some of them have environment variable counterparts (see tests/integration/conftest.py),
which can be set instead of passing them as arguments, which is more secure for sensitive data.
There is also a tox root in the charm directory, which can be used to lint and format the charm code:
cd charm
tox run -e fmt # update your code according to linting rules
tox run -e lint # code styleFlask contains a development server that can be used to test the charm. To start the server, run:
python -m src.appin your virtual environment and project root.
Build the charm in this git repository using:
charmcraft pack