Skip to content

Latest commit

 

History

History
99 lines (59 loc) · 2.63 KB

CONTRIBUTING.md

File metadata and controls

99 lines (59 loc) · 2.63 KB

Contributing to srai

Contributing to the code base

Getting started

To make changes to srai's code base, you need to fork and then clone the GitHub repository.

For first setup of the project locally, the following commands have to be executed.

  1. Make sure you have installed at least version 3.9+ of Python.

  2. Install PDM (only if not already installed)

    pip install pdm
  3. Install package locally (will download all dev packages and create a local venv)

    # Optional if you want to create venv in a specific version. More info: https://pdm.fming.dev/latest/usage/venv/#create-a-virtualenv-yourself
    pdm venv create 3.9 # or any higher version of Python
    
    pdm install -G:all
  4. Activate pdm venv

    eval $(pdm venv activate)
    
    # or
    
    source ./venv/bin/activate
  5. Activate pre-commit hooks

    pre-commit install && pre-commit install -t commit-msg

Testing

For testing, tox is used to allow testing on multiple Python versions.

To test code locally before committing, run:

tox -e python3.9 # put your python version here

Documentation

This repository uses MkDocs as a documentation generator. To build and serve the documentation locally, run:

mkdocs serve

Docstrings should be written following the google convention. To ease development one can use autoDocstring extension to generate the docstrings.

Python conventions

All Python code must be written compatible with Python 3.9+.

Deployment

Releasing a new version

To release a new version:

bumpver update --patch

This command will update the version strings across the project, commit and tag the commit with the new version. All you need to do is to push the changes.