Go to file
Stijn De Clercq 5bfb1cecb2
Merge pull request #159 from stijndcl/3.3.0
3.3.0
2023-01-11 23:18:08 +01:00
.github
alembic
database Only show upcoming deadlines for courses the user is actually subscribed to 2022-11-05 22:26:48 +01:00
didier Check escaped message length before mocking it 2022-11-21 22:49:23 +01:00
files/dictionaries
profile_pictures
tests
.editorconfig
.flake8 Fix db script runner 2022-10-19 22:37:17 +02:00
.gitignore
.pre-commit-config.yaml
.python-version
alembic.ini
codecov.yaml
docker-compose.test.yml
docker-compose.yml
main.py Load calendars once on startup (before connecting) 2022-11-02 01:34:52 +01:00
pyproject.toml
readme.md
requirements-dev.txt
requirements.txt
run_db_scripts.py Fix db script runner 2022-10-19 22:37:17 +02:00
settings.py

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.