Go to file
stijndcl 654fbcd46b Start working on food, make embeds prefer title instead of author, add custom colour for ghent university blue 2022-08-28 20:16:36 +02:00
.github Require no auth for mongo in tests 2022-07-27 22:02:59 +02:00
alembic Command to add memes 2022-08-25 02:07:02 +02:00
database Memegen works 2022-08-25 11:04:25 +02:00
didier Start working on food, make embeds prefer title instead of author, add custom colour for ghent university blue 2022-08-28 20:16:36 +02:00
files/dictionaries Fix broken time formatting, remove word field 2022-07-26 21:48:50 +02:00
tests Rework links 2022-08-10 01:04:19 +02:00
.editorconfig Initialize database stuff & setup didier 2022-06-10 01:48:02 +02:00
.flake8 Translate to english 2022-07-24 17:09:42 +02:00
.gitignore Bank upgrades 2022-07-03 17:44:16 +02:00
.pre-commit-config.yaml Add birthday commands 2022-07-19 22:58:59 +02:00
.python-version Bump python version 2021-06-20 11:45:34 +02:00
alembic.ini Add missing alembic file 2022-06-16 00:40:37 +02:00
codecov.yaml Urban dictionary commands 2022-07-14 20:28:45 +02:00
docker-compose.test.yml Require no auth for mongo in tests 2022-07-27 22:02:59 +02:00
docker-compose.yml Fix mongo connection 2022-07-25 20:33:20 +02:00
main.py Make fancy functions for database & http stuff, meme preview 2022-08-26 20:02:54 +02:00
pyproject.toml First tests for game stats 2022-07-30 18:27:58 +02:00
readme.md Try to fix actions, fix broken test 2022-07-27 21:49:58 +02:00
requirements-dev.txt Fix bug, add autocomplete, make cache autocompletion slightly cleaner 2022-08-13 01:10:50 +02:00
requirements.txt Update to 2.0 release of dpy 2022-08-22 00:18:40 +02:00
settings.py Command to add memes 2022-08-25 02:07:02 +02:00

readme.md

Didier

wakatime

You bet. The time has come.

Development

Didier uses Python 3.9.5, as specified in the .python-version-file. This file will cause pyenv to automatically use the correct version when you're working on Didier.

# Installing Python 3.9.5 through pyenv
pyenv install 3.9.5

# Creating a Virtual Environment and activate it
# PyCharm will automatically activate your venv
python3 -m venv venv
source venv/bin/activate

# Installing dependencies + development dependencies
pip3 install -r requirements.txt -r requirements-dev.txt

# Installing pre-commit hooks
pre-commit install

The database can be managed easily using Docker Compose. If you want to, however, you can run a regular PostgreSQL server and connect to that instead.

A separate database is used in the tests, as it would obviously not be ideal when tests randomly wipe your database.

# Starting the database
docker compose up -d

# Starting the database used in tests
docker compose -f docker-compose.test.yml up -d

Commands

# Starting Didier
python3 main.py

# Running database migrations
alembic upgrade head

# Creating a new database migration
alembic revision --autogenerate -m "Revision message here"

# Running tests
pytest

# Running tests with Coverage
coverage run -m pytest
# Generating code coverage report
coverage html

# Running code quality checks
black
flake8
mypy

It's also convenient to have code-formatting happen automatically on-save. The Black documentation explains how to set this up for different types of editors.