Skip to content

Latest commit

 

History

History
115 lines (77 loc) · 2.95 KB

CONTRIBUTING.md

File metadata and controls

115 lines (77 loc) · 2.95 KB

Contributing Guide

This guide is for anyone who wishes to contribute code to Bhagavad Gita API.

Thank you for your interest and welcome here!

To work on this project you will need the following software installed in your machine.

  • git (version control)
  • python3.10 or above
  • poetry (package management)
  • make (command line utils)
  • docker (optional, if you want to build docker images)
  • docker-compose (optional, if you want to develop with docker-compose)
  1. First of all fork and clone this repo. Checkout a new branch to start working. For more information read GitHub's Docs for beginners.

  2. If you don't already have poetry, then install it. Move into the project directory and run the following commands.

    poetry config virtualenvs.in-project true
    poetry install
  3. The virtual environment will be created in a .venv folder inside your project directory. In your code editor set the python interpretor path to ./.venv/bin/python

  4. Activate poetry shell.

    poetry shell
  5. Install pre-commit hooks.

    pre-commit install
  6. Setup .env file refer .env.example.

    cp .env.example .env
  7. Seed data to database.

    python bhagavad_gita_api/cli.py seed-data
  8. To start the server with hot reload,

    uvicorn bhagavad_gita_api.main:app --host 0.0.0.0 --port 8081 --reload

    By default an in memory Sqlite database is used. To set the database DSN, tester API Key and other stuff, read about configuration in the README.

  9. Try to write test cases when you are adding a feature or fixing a bug.

  10. Make sure that all existing tests, and code quality checks pass.

    pytest # run tests
    pre-commit run -a # run pre-commit for all files
  11. Make sure to write meaningful commit messages.

  12. Open a PR. Please explain what your changes does in a simple words. Attach logs, screenshots and other relevant material.

Congrats and thanks for opening your first PR! Please wait for the maintainers to respond.


Developing with Docker and docker-compose

# setup .env file, refer .env.example file
cp .env.example .env

# run the project with docker-compose
docker-compose -f docker-compose.dev.yml up --build

Contributors List

To add yourself to the contributors list, comment on an Issue or Pull Request, asking @all-contributors to add a contributor:

@all-contributors please add @<username> for <contributions>

<contribution>: See the Emoji Key (Contribution Types Reference) for a list of valid contribution types.

The bot will then create a Pull Request to add the contributor, then reply with the pull request details.

Example usage screenshot