cd && git clone # path-to-this-repository.git
cd # path-to-downloaded-repository
Verify if Python is installed.
python --version
To install multiple Python versions, use pyenv.
To activate pyenv
:
pyenv local 3.11 3.12
sudo apt install -y mosquitto mosquitto-clients
python -m venv .env
source .env/bin/activate
python -m pip install --upgrade pip setuptools
pip install -e .[dev]
pre-commit install
pre-commit autoupdate
pre-commit run --all-files
Start server
sudo mosquitto -v
Listen to messages
mosquitto_sub -v -t '#' -h 127.0.0.1
Publish a message
mosquitto_pub -t 'led/strip/set' -h 127.0.0.1 -m 0
Stop Mosquitto server:
sudo systemctl stop mosquitto
See tox for all test environments.
To run all:
tox
To run a specific environment:
tox -e py312
To generate documentation:
tox -e docs
The HTML pages are in docs/build/html.