A Python project template
-
Clone/download this repository.
-
python3 -m pip install --user pipx python3 -m pipx ensurepath pipx install peotry # add poetry to PATH
-
Next, customize
pyproject.toml
and install with poetry:poetry install
Make sure to select the poetry env as kernel in VSCode: Ctrl + Shift + P ->
Select Interpreter
| Note: Update dependencies in
pyproject.toml
afterpoetry update
. Also update versions inpre-commit-config.yaml
. To remove a poetry env, tpye:rm -rf $(poetry config virtualenvs.path)/*
Create a new config.ini
based on the config.ini.template.
pre-commit
is installed as part of the dev dependencies. Run pre commit
from cli to execute pre-commits hook to sort, format and lint the code.
If you want to use PostgreSQL as database, fire up a docker environment e.g. as provided in the compose.yaml
:
sudo service docker start
sudo docker-compose -f compose.yaml --env-file config.ini up -d
Don't forget to provide the credentials within the config.ini
.
If everything is prepared as suggested above , use the script start.sh
to:
- start docker service
- stop and clean up all containers
- clean the (otherwise) persistent database volume
- initialize containers
chmod +x start.sh
./start.sh