Skip to content

Latest commit

 

History

History
73 lines (57 loc) · 1.97 KB

CONTRIBUTING.md

File metadata and controls

73 lines (57 loc) · 1.97 KB

Check open issues

https://github.com/danionescu0/docker-flask-mongodb-example/issues consider taking on an issue, or adding a new one.

Working on a issue

  • To start developing locally using anaconda:
cd docker--mongodb-example
conda create --name dockerflaskmongodbexample python=3.10.0
conda activate dockerflaskmongodbexample
  • Install proper requirements.txt coresponding to the module you will be working for, example:
pip install -r python/fastapidemo/requirements.txt
  • Add common package in pythonpath (searching for a solution to that)
export PYTHONPATH=/your_project_path/python/common/
  • If you created a new service or modified some connexions between services, you may need to generate a new diagram. I have created a diagram using this tool: https://diagrams.mingrammer.com

To generate a new one install diagrams and graphviz packages inside your conda env:

pip install -r python/requirements-dev.txt

Now you're ready to modify "diagrams_generator.py" inside python folder then run the generator

cd python
python diagrams_generator.py

It will replace the ./resources/autogenerated.png file

  • Run unit tests with pytest and fix the tests if they are failing, if it's new feature create a new test inside /tests folder
  • first run the app locally
docker compose up
  • then install tests requirements in a separate anaconda environment
cd docker--mongodb-example
conda create --name dockerflaskmongodbexampletestenv python=3.10.0
conda activate dockerflaskmongodbexampletestenv
pip install -r tests/requirements.txt
  • run all tests
pytest -s
  • to run just a specific test:
pytest -q tests/test_0_users.py  -s
  • Work on branch, modify what you need
  • Run black () to format the code properly (if not the build will fail on push)
cd docker--mongodb-example
pip install -r python/requirements-dev.txt
black .
  • Push and create a pull request