2021-04-03 20:48:46 +00:00
# Contributing to aMQTT
2021-03-15 11:02:28 +00:00
:+1::tada: First off, thanks for taking the time to contribute! :tada::+1:
2021-04-03 20:48:46 +00:00
The following is a set of guidelines for contributing to aMQTT on GitHub. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request.
2021-03-15 11:02:28 +00:00
2021-03-21 15:31:22 +00:00
## Development Setup
### Requirements
2025-05-22 01:59:12 +00:00
1. Install [uv ](https://docs.astral.sh/uv/getting-started/installation/ )
2. Use `uv python install <version>` to install [3.10, 3.11, 3.12 or 3.13 ](https://docs.astral.sh/uv/guides/install-python/ )
3. Fork repository (if you intend to open a pull request)
4. Clone repo `git clone git@github.com:<username>/amqtt.git`
5. Add repo to receive latest updates `git add upstream git@github.com:Yakio/amqtt.git`
2021-03-21 15:31:22 +00:00
2025-05-22 01:59:12 +00:00
### Installation
2021-03-21 15:31:22 +00:00
2025-05-22 01:59:12 +00:00
Create and start virtual environment with `UV`
2024-12-19 19:34:09 +00:00
2025-05-22 01:59:12 +00:00
```shell
uv venv .venv --python 3.13.0
source .venv/bin/activate
2021-03-21 15:31:22 +00:00
```
2025-05-22 01:59:12 +00:00
Install the package with development (and doc) dependencies:
2024-12-19 19:34:09 +00:00
2025-05-22 01:59:12 +00:00
```shell
uv pip install -e . --group dev --group doc
2021-03-21 15:31:22 +00:00
```
2025-05-22 01:59:12 +00:00
Add git pre-commit checks (which parallel the CI checks):
2024-12-19 19:34:09 +00:00
2025-05-22 01:59:12 +00:00
```shell
pre-commit install
```
### Run
Run CLI commands:
```shell
2025-04-04 19:06:41 +00:00
uv run amqtt
uv run amqtt_pub
uv run amqtt_sub
2021-03-21 15:31:22 +00:00
```
2025-05-22 01:59:12 +00:00
Run the test case suite:
2021-03-21 15:31:22 +00:00
2025-05-22 01:59:12 +00:00
```shell
pytest
2021-03-21 15:31:22 +00:00
```
2024-12-19 19:34:09 +00:00
2025-05-22 01:59:12 +00:00
Run the type checker and linters manually:
2021-03-21 15:31:22 +00:00
2025-05-22 01:59:12 +00:00
```shell
pre-commit run --all-files
```
2021-03-21 15:31:22 +00:00
2021-03-15 11:02:28 +00:00
## Testing
2025-05-22 01:59:12 +00:00
When adding a new feature, please add corollary tests. The testing coverage should not decrease.
2021-04-03 20:48:46 +00:00
If you encounter a bug when using aMQTT which you then resolve, please reproduce the issue in a test as well.