Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"name": "SAIC Python MQTT Gateway Dev",
"image": "mcr.microsoft.com/devcontainers/python:3.12",
"runArgs": [
"--env-file",
".env"
],
"customizations": {
"vscode": {
"settings": {
"launch": {
"configurations": [
{
"name": "Python: Debug Gateway",
"type": "debugpy",
"request": "launch",
"program": "./src/main.py",
"justMyCode": true,
"console": "integratedTerminal"
}
],
"compounds": []
},
"python.testing.pytestArgs": [
"tests"
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"python.defaultInterpreterPath": "./.venv/bin/python",
"terminal.integrated.shell.linux": "/bin/bash",
"[python]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "charliermarsh.ruff"
}
},
"extensions": [
"charliermarsh.ruff",
"ms-azuretools.vscode-docker",
"ms-python.debugpy",
"ms-python.mypy-type-checker",
"ms-python.pylint",
"ms-python.python",
"ms-python.vscode-pylance"
]
}
},
"postCreateCommand": [
".devcontainer/setup.sh"
],
"containerEnv": {
"PYTHONPATH": "${containerWorkspaceFolder}/src"
},
"remoteEnv": {
"MQTT_URI": "${containerEnv:MQTT_BROKER_URI}",
"MQTT_USER": "${containerEnv:MQTT_USERNAME}",
"MQTT_PASSWORD": "${containerEnv:MQTT_PWD}",
"SAIC_USER": "${containerEnv:SAIC_USERNAME}",
"SAIC_PASSWORD": "${containerEnv:SAIC_PWD}"
}
}
19 changes: 19 additions & 0 deletions .devcontainer/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash
set -ex


# install system dependencies
pip install poetry


# install python dependencies
poetry install --no-interaction


# fix dubious ownership warning
git config --global --add safe.directory $(pwd)

# install pre-commit git hooks

#pre-commit install
#pre-commit install --hook-type commit-msg