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)
-
First of all fork and clone this repo. Checkout a new branch to start working. For more information read GitHub's Docs for beginners.
-
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
-
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
-
Activate poetry shell.
poetry shell
-
Install pre-commit hooks.
pre-commit install
-
Setup .env file refer .env.example.
cp .env.example .env
-
Seed data to database.
python bhagavad_gita_api/cli.py seed-data
-
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.
-
Try to write test cases when you are adding a feature or fixing a bug.
-
Make sure that all existing tests, and code quality checks pass.
pytest # run tests pre-commit run -a # run pre-commit for all files
-
Make sure to write meaningful commit messages.
-
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.
# 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
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.