Allow for debugging

This commit is contained in:
Jacob Windsor 2025-02-19 16:40:13 +01:00
parent ecfef9a09d
commit 6dd5f2780e
7 changed files with 64 additions and 4 deletions

1
.gitignore vendored
View File

@ -174,3 +174,4 @@ cython_debug/
.pypirc .pypirc
venv venv
.ruff_cache

10
.vscode/extensions.json vendored Normal file
View File

@ -0,0 +1,10 @@
{
"recommendations": [
"charliermarsh.ruff",
"ms-python.python",
"ckolkman.vscode-postgres",
"ms-vscode.makefile-tools",
]
}

25
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,25 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug: Backend",
"type": "debugpy",
"request": "launch",
"module": "uvicorn",
"cwd": "${workspaceFolder}/backend",
"args": [
"app.main:app",
"--reload",
"--reload-include",
"backend/src",
"--port",
"8080"
],
"jinja": true,
"justMyCode": false,
"consoleName": "Backend",
"preLaunchTask": "Start DB",
"python": "${workspaceFolder}/venv/bin/python",
},
]
}

View File

@ -1,8 +1,11 @@
{ {
"python.defaultInterpreterPath": ".venv/bin/python", "python.defaultInterpreterPath": "venv/bin/python",
"editor.formatOnSave": true, "editor.formatOnSave": true,
"[python]": { "[python]": {
"editor.defaultFormatter": "ms-python.python", "editor.defaultFormatter": "charliermarsh.ruff",
"editor.formatOnSave": true, "editor.codeActionsOnSave": {
"source.fixAll": "explicit",
"source.organizeImports": "explicit"
}
}, },
} }

17
.vscode/tasks.json vendored Normal file
View File

@ -0,0 +1,17 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Start All",
"type": "shell",
"command": "docker compose up -d",
"problemMatcher": []
},
{
"label": "Start DB",
"type": "shell",
"command": "docker compose up -d db",
"problemMatcher": []
},
]
}

View File

@ -19,3 +19,6 @@ start:
clean: clean:
rm -rf $(VENV_DIR) rm -rf $(VENV_DIR)
clean-db:
docker compose down -v db

View File

@ -7,3 +7,4 @@ pydantic-settings
python-dotenv python-dotenv
pg8000 pg8000
asyncpg asyncpg
greenlet