You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
stijndcl 950b7330d0 Add modsim role 4 days ago
.github Remove mongo from CI 1 month ago
alembic Start working on new roles 1 week ago
database Add modsim role 4 days ago
didier Show error message if no definitions are found 5 days ago
files/dictionaries Fix broken time formatting, remove word field 2 months ago
profile_pictures Typing 1 week ago
tests Fix migration & broken test 2 weeks ago
.editorconfig Initialize database stuff & setup didier 4 months ago
.flake8 Translate to english 2 months ago
.gitignore Merge migrations, pull schedules daily 2 weeks ago
.pre-commit-config.yaml Remove mongo & fix tests 1 month ago
.python-version Bump python version 1 year ago
alembic.ini Add missing alembic file 4 months ago
codecov.yaml Urban dictionary commands 3 months ago
docker-compose.test.yml Remove mongo & fix tests 1 month ago
docker-compose.yml Remove mongo & fix tests 1 month ago
main.py Sending schedules in discord, small fixes 2 weeks ago
pyproject.toml Fix env variable 2 weeks ago
readme.md Add OS info to dev readme 1 month ago
requirements-dev.txt Fix bug, add autocomplete, make cache autocompletion slightly cleaner 2 months ago
requirements.txt List memes 1 week ago
run_db_scripts.py Use importlib for db scripts 2 weeks ago
settings.py Remove unnecessary setting, add check around schedule parsing 1 week ago

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

All of these are Python tools. Depending on your OS and configuration, you may have to prefix them with python3 -m.

# 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.