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.
Go to file
Stijn De Clercq 4de765ef62
Merge pull request #169 from stijndcl/events-qol
1 month ago
.github Update CI & fix broken test 2 months ago
alembic Start working on events 1 month ago
database Small bugfix in timezone printing 1 month ago
didier Small bugfix in timezone printing 1 month ago
files/dictionaries Fix broken time formatting, remove word field 8 months ago
profile_pictures Typing 6 months ago
tests Update CI & fix broken test 2 months ago
.editorconfig Initialize database stuff & setup didier 10 months ago
.flake8 Fix db script runner 5 months ago
.gitignore Merge migrations, pull schedules daily 6 months ago
.pre-commit-config.yaml Fix pre-commit hooks 1 month ago
.python-version Bump python version 2 years ago
alembic.ini Add missing alembic file 9 months ago
codecov.yaml Urban dictionary commands 8 months ago
docker-compose.test.yml Remove mongo & fix tests 7 months ago
docker-compose.yml Remove mongo & fix tests 7 months ago
main.py Load calendars once on startup (before connecting) 5 months ago
pyproject.toml Fix env variable 6 months ago
readme.md Add OS info to dev readme 7 months ago
requirements-dev.txt Fix pre-commit hooks 1 month ago
requirements.txt Fix announcement timezones 6 months ago
run_db_scripts.py Fix db script runner 5 months ago
settings.py Tidy up events a bit 1 month 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.