Branch | Status |
---|---|
develop | |
master |
service-control
provides and manages the verified permissions. TBC
Prerequisites on host for development and build:
- python version 3.12
- pipenv
docker
anddocker compose
Copy the .env.dist
file to .env
on your local machine:
cp .env.dist .env
Initialize the local python environment with pipenv:
pipenv sync -d
and start the local postgres container
docker compose up
There are some possibilities to debug this codebase from within visual studio code.
In order to debug the service from within vs code, you need to create a launch-configuration. Create
a folder .vscode
in the root folder if it doesn't exist and put a file launch.json
with this content
in it:
{
"version": "0.2.0",
"configurations": [
{
"name": "Python Debugger: Attach",
"type": "debugpy",
"request": "attach",
"justMyCode": false,
"connect": {
"host": "localhost",
"port": 5678
}
}
]
}
Now you can start the server with make serve-debug
. The bootup will wait with the execution until
the debugger is attached, which can most easily done by hitting f5.
The same process described above can be used to debug tests. Simply run make test-debug
, they will
then wait until the debugger is attached.
The unit tests can also be invoked inside vs code directly. To do this you need to have following settings locally to your workspace:
"python.testing.pytestArgs": [
"app"
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"python.testing.debugPort": 5678
They can either be in .vscode/settings.json
or in your workspace settings. Now the tests can be
run and debugged with the testing tab of vscode (beaker icon).