Run main script that publish and subscribes to MQTT
poetry run pub-sub
Install pyenv
brew update
brew install pyenv
Install poetry
brew update
brew install pipx
pipx install poetry
Upgrade poetry
pipx upgrade poetry
or
poetry self update
Upgrade poetry dependencies
Get the latest versions of the dependencies and to update the poetry.lock
file
poetry update
Start shell
poetry shell
Install all dependencies (main and dev)
poetry install
Install main dependencies only
poetry install --only main
Install git hooks scripts
pre-commit install
Run the hooks against all files
pre-commit run --all-files
Add main package
poetry add <package>
Add dev package
poetry add <package> --group dev
Check and update outdated dependencies
poetry show --outdated
poetry add <outdated package>@latest
To update documentation of the user settings as JSON schema settings.json and markdown settings.md
poetry run generate_docs
pytest is used as test framework.
poetry run pytest
pytest-cov is used to produce test coverage reports.
poetry run coverage run -m pytest -vv && poetry run coverage report
In order to run tests easily in IntelliJ you should install the plugin pytest imp.
You should also configure the path to the pyproject.toml in the pytest plugin at Settings > Tools > Python Integrated Tools > py.test
Black code style is used as code style.
You can do a style check, without fixing the issues:
poetry run black src tests --check --diff
or fix the issues automatically:
poetry run black src tests
Pylint is used for static code analysis.
poetry run pylint src
isort is used to verify import ordering.
You can do a check, without fixing the issues:
poetry run isort src tests --check --diff
or fix the issues automatically:
poetry run isort src tests