Skip to content

Commit

Permalink
Add devcontainer (#279)
Browse files Browse the repository at this point in the history
  • Loading branch information
frenck authored Aug 9, 2023
1 parent d84d05e commit 639ba24
Show file tree
Hide file tree
Showing 4 changed files with 109 additions and 1 deletion.
73 changes: 73 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
"name": "Spook development environment",
"image": "mcr.microsoft.com/devcontainers/python:1-3.11-bullseye",
"features": {
"ghcr.io/devcontainers/features/github-cli:1": {
"installDirectlyFromGitHubRelease": true,
"version": "latest"
},
"ghcr.io/devcontainers/features/node:1": {
"nodeGypDependencies": true,
"version": "lts"
},
"ghcr.io/devcontainers-contrib/features/poetry:2": {
"version": "latest"
}
},
"forwardPorts": [8123, 3000],
"portsAttributes": {
"8123": {
"label": "Home Assistant",
"onAutoForward": "openBrowserOnce"
},
"3000": {
"label": "Documentation",
"onAutoForward": "openBrowserOnce"
},
"3100": {
"label": "Documentation (live updates)",
"autoForward": "silent"
}
},
"postCreateCommand": "mkdir -p config && poetry config virtualenvs.in-project true && npm install -g mystmd && poetry install",
"updateContentCommand": "poetry config virtualenvs.in-project true && poetry install",
"containerEnv": {
"DEVCONTAINER": "1"
},
"remoteUser": "vscode",
"customizations": {
"vscode": {
"extensions": [
"ms-python.vscode-pylance",
"ms-python.python",
"redhat.vscode-yaml",
"esbenp.prettier-vscode",
"GitHub.vscode-pull-request-github",
"GitHub.copilot",
"GitHub.vscode-github-actions",
"yzhang.markdown-all-in-one"
],
"settings": {
"python.pythonPath": "/usr/local/bin/python",
"editor.formatOnPaste": false,
"editor.formatOnSave": true,
"editor.formatOnType": true,
"files.trimTrailingWhitespace": true,
"terminal.integrated.profiles.linux": {
"zsh": {
"path": "/usr/bin/zsh"
}
},
"terminal.integrated.defaultProfile.linux": "zsh",
"yaml.customTags": [
"!input scalar",
"!secret scalar",
"!include_dir_named scalar",
"!include_dir_list scalar",
"!include_dir_merge_list scalar",
"!include_dir_merge_named scalar"
]
}
}
}
}
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ ENV/
.ruff_cache

# Visual Studio Code
.vscode
.vscode/*

# IntelliJ Idea family of suites
.idea
Expand Down Expand Up @@ -124,3 +124,8 @@ node_modules/
# Mystjs
.ipynb_checkpoints
_build

# Devcontainer
config
!.vscode/tasks.json
!.vscode/launch.json
15 changes: 15 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Home Assistant with Spook",
"type": "python",
"request": "launch",
"python": "${workspaceFolder}/.venv/bin/python",
"module": "homeassistant",
"cwd": "${workspaceFolder}",
"justMyCode": false,
"args": ["--debug", "-c", "config"]
}
]
}
15 changes: 15 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Preview documentation",
"type": "shell",
"command": "cd documentation && myst start",
"problemMatcher": [],
"presentation": {
"reveal": "always",
"panel": "new"
}
}
]
}

0 comments on commit 639ba24

Please sign in to comment.