Contribution guide

Setting up the environment

$ git clone git@github.com:Saluev/suppgram.git
$ cd suppgram
$ python -m pip install -r requirements.txt


Running tests

To run all tests, you'll need running MongoDB and PostgreSQL instances. The easiest way to get one is by using Docker:

$ docker run -p 27107:27017 -d mongo:latest
$ docker run -p 5432:5432 -e POSTGRES_USER=suppgram -e POSTGRES_PASSWORD=test -e POSTGRES_DB=suppgram_test -d postgres:latest

Then the tests can be run via pytest:

$ PYTHONPATH=. pytest


Running static checks

Suppgram uses mypy for type checking and ruff as a linter. Just run

mypy suppgram
ruff supppram

Feel free to add these commands to your pre-commit hook.


Working with Alembic

Your current SQLAlchemy URL must be specified in alembic.ini (sqlalchemy.url setting).

To migrate to current state of things:

python -m alembic upgrade head

To create a new migration:

python -m alembic revision --autogenerate -m "..."


Running documentation locally

mkdocs serve