Go to file
Stijn De Clercq 016d87bcea
Merge pull request #121 from stijndcl/pre-commit
Add pre-commit hooks
2022-07-19 21:39:39 +02:00
.github Update readme & config files 2022-07-19 21:33:18 +02:00
alembic Try to use migrations in tests 2022-07-19 18:49:22 +02:00
database Small cleanup 2022-07-19 18:57:24 +02:00
didier Fix typing & linting 2022-07-18 23:39:14 +02:00
tests Try to use migrations in tests 2022-07-19 18:49:22 +02:00
.editorconfig Initialize database stuff & setup didier 2022-06-10 01:48:02 +02:00
.flake8 Add study guide commands, get auto-completion for full course names based on aliases 2022-07-15 23:06:40 +02:00
.gitignore Bank upgrades 2022-07-03 17:44:16 +02:00
.pre-commit-config.yaml Add pre-commit config, make tests a requirement for quality checks 2022-07-19 21:12:04 +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.yml Add test container 2022-06-29 00:14:44 +02:00
main.py Switch to flake8 2022-07-11 22:23:38 +02:00
pyproject.toml Update readme & config files 2022-07-19 21:33:18 +02:00
readme.md Update readme & config files 2022-07-19 21:33:18 +02:00
requirements-dev.txt Fix typing & linting 2022-07-18 23:39:14 +02:00
requirements.txt Google search 2022-07-18 23:22:28 +02:00
settings.py Load year from settings 2022-07-15 23:14:56 +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 db

# Starting the database used in tests
docker-compose up -d db-pytest

Commands

# Starting Didier
python3 main.py

# Running tests
pytest

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

# Running code quality checks
black
flake8
mypy