You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
1.6 KiB
Markdown
62 lines
1.6 KiB
Markdown
# learn_dramatiq
|
|
|
|
Learn Dramatiq basics
|
|
|
|
## Docker Compose Backends
|
|
|
|
Since Dramatiq supports Redis and RabbitMQ as queue backends, there are two separate docker-compose files for each. The redis backend has no persistence, while the rabbit backend has a `.rabbitdata/` persistence attached as a volume mount.
|
|
|
|
## Invoke
|
|
|
|
All invoke tasks reside in the `tasks.py` file at the root of the project. Use `invoke --list` or `inv -l` to print out a list of available commands. Use `inv <cmd> --help` for additional details.
|
|
|
|
A bash complete wrapper script `autocomplete.zsh` was generated with `invoke --print-completion-script zsh > autocomplete.zsh`. Simply source this file to enable autocomplete for invoke. Use `bash` instead of `zsh` to generate a bash autocomplete wrapper.
|
|
|
|
## Pre-commit Hooks
|
|
|
|
A `.pre-commit-config.yaml` for [pre-commit](https://pre-commit.com/) is available for this project. To install the pre-commit hooks run:
|
|
|
|
```
|
|
pre-commit install
|
|
```
|
|
|
|
In the event new hooks are addedd it may be beneficial to run all hooks against all files:
|
|
|
|
```
|
|
pre-commit run --all-files
|
|
```
|
|
|
|
You can run individual pre-commit hooks like:
|
|
|
|
```
|
|
pre-commit run pylint
|
|
```
|
|
|
|
This will use the args present in hook, which in our case ignores C,R, and TODO fixme commands.
|
|
|
|
To remove the pre-commit hooks all together
|
|
|
|
```
|
|
rm .git/hooks/pre-commit
|
|
```
|
|
|
|
## Pylint
|
|
|
|
To disable a rule
|
|
|
|
```
|
|
# pylint: disable=unused-import
|
|
import not_used
|
|
# pylint: disable=enable-import
|
|
```
|
|
|
|
or
|
|
|
|
```
|
|
bad_code # pylint: disable=W1337
|
|
```
|
|
|
|
You can also suppress the entire rule by adding a pragma disable at the top of the file
|
|
|
|
# pragma pylint: disable=W9902
|