From ea70deff54056577faa5c3a8c154fa54b9721605 Mon Sep 17 00:00:00 2001 From: Andrew Cockburn Date: Sat, 25 Jan 2025 14:23:46 -0500 Subject: [PATCH] Don;t ignore devcontainer --- .devcontainer/Dockerfile | 20 ++++++++++++ .devcontainer/devcontainer.json | 56 +++++++++++++++++++++++++++++++++ .gitignore | 1 - 3 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 000000000..9abc32d25 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,20 @@ +ARG PYTHON_RELEASE=3.12 +ARG BASE_IMAGE=mcr.microsoft.com/devcontainers/python:${PYTHON_RELEASE} +# Runtime image +FROM ${BASE_IMAGE} + +# Copy Repo across +COPY . /usr/src/appdaemon/ + +# Install AD Dependencies +RUN pip install -r /usr/src/appdaemon/requirements.txt + +# Add dev dependencies +RUN pip install -r /usr/src/appdaemon/dev-requirements.txt + +# Add doc dependencies +RUN pip install -r /usr/src/appdaemon/doc-requirements.txt + +# Install AppDaemon itself to keep VSCODE happy + +RUN pip install /usr/src/appdaemon diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 000000000..2054eaa6b --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,56 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-dockerfile +{ + "name": "appdaemon-dev", + "build": { + // Sets the run context to one level up instead of the .devcontainer folder. + "context": "..", + // Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename. + "dockerfile": "Dockerfile", + "args": { + "PYTHON_RELEASE": "3.13" // This overrides the default of 3.12 + } + }, + + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + //"forwardPorts": ["4949:4949"], + "appPort": [ "4949:4949" ], + // Uncomment the next line to run commands after the container is created. + // "postCreateCommand": "cat /etc/os-release", + + // Uncomment to connect as an existing user other than the container default. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "devcontainer" + + "mounts": [ + "source=${localEnv:HOME}${localEnv:USERPROFILE}/production/,target=/conf,type=bind,consistency=cached" + ], + + // Configure tool-specific properties. + "customizations": { + "vscode": { + "extensions": [ + "ms-python.python", + "njpwerner.autodocstring", + //"ms-python.black-formatter", + //"ms-python.isort", + "shd101wyy.markdown-preview-enhanced", + //"ms-python.pylint", + "DavidAnson.vscode-markdownlint", + "ms-python.debugpy", + "njqdev.vscode-python-typehint", + "charliermarsh.ruff", + "ms-python.vscode-pylance", + "lkytal.quicktask", + "ms-azuretools.vscode-docker", + "github.vscode-github-actions", + "eamodio.gitlens", + "Gruntfuggly.todo-tree", + "tamasfe.even-better-toml" + ] + + } + } +} diff --git a/.gitignore b/.gitignore index 1681abdff..ad83fce2e 100644 --- a/.gitignore +++ b/.gitignore @@ -76,7 +76,6 @@ venv # IDE .vscode -.devcontainer # Docs