This is the base python base repo for any project to kickstart. There are 2 major components to this:
- Flask App: REST APIs
- Worker: Celery Workers for Async Tasks
Create & Activate a Virtual Environment
sudo pip install virtualenv
virtualenv ~/Projects/venv/events-env -p python3.8.3
source ~/Projects/venv/events-env/bin/activate
Installing Requirements
pip install -r requirements.txt
Setup Redis (Broker)
brew install redis
brew services start redis
Start the Flask Application
python app/flask_app.py
Start Workers
celery -A app.worker worker --loglevel=debug
docker-compose -f build
docker-compose up
Install The App as a python package
pip install -e .
Run the Tests
pytest
Get the coverage Report
coverage run -m pytest
coverage report
- Writing tests
- Ensure that the code coverage is > 90%
- Code review
- Create a Feature / Hotfix Branch
- Start your commit messages with the JIRA Ticket ID
- [ZOHO-111]: Setting up the unit tests
- Add 2 Reviewers
- Other guidelines