This is an example for python api to publish/consume RabbitMQ messages.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project.
- git
- python 3.9
- pip
- vscode
- docker (to run local tests)
First of all you need to clone this repository:
git clone https://github.com/claick-oliveira/amazonmq-api-example.git
After clone access the folder and create your virtual env:
cd amazonmq-api-example
To start to code you need to install the requirements and de dev requirements:
pip install -r requirements.txt
pip install -r requirements_dev.txt
To run the you will need a container running rabbitmq. To start the container you need to execute:
docker run -d --rm --hostname mock-rabbit --name mock-rabbit -e RABBITMQ_DEFAULT_USER=mock -e RABBITMQ_DEFAULT_PASS=mock -p 5671:5671 -p 5672:5672 rabbitmq:latest
Now you can run the tests:
tox
NOTE: After the tests you can stop the container with the command
docker stop mock-rabbit
.
In this project we'll use PEP 8 as style guide.
To clean the files generated as coverage, builds, env you can use:
make clean
If you prefer to clear all, use:
make cleanfull
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
- Claick Oliveira - Initial work - claick-oliveira
See also the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE file for details