From fe90960e6aadec7cca5083c326250bbe3feccf1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn-Michael=20Miehe?= Date: Fri, 27 Oct 2023 20:55:20 +0200 Subject: [PATCH] api: update project scaffolding --- api/.devcontainer/Dockerfile | 23 +++++++++++++++-------- api/.devcontainer/devcontainer.json | 4 ++-- api/.vscode/settings.json | 5 ++--- 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/api/.devcontainer/Dockerfile b/api/.devcontainer/Dockerfile index 733261d..cfc9d4e 100644 --- a/api/.devcontainer/Dockerfile +++ b/api/.devcontainer/Dockerfile @@ -1,11 +1,20 @@ # See here for image contents: https://github.com/devcontainers/images/blob/main/src/python/.devcontainer/Dockerfile -# [Choice] Python version (use -bullseye variants on local arm64/Apple Silicon): -# - 3, 3.11, 3.10, 3.9, 3.8, 3.7, 3.6 -# - 3-bullseye, 3.11-bullseye, 3.10-bullseye, 3.9-bullseye, 3.8-bullseye, 3.7-bullseye, 3.6-bullseye -# - 3-buster, 3.11-buster, 3.10-buster, 3.9-buster, 3.8-buster, 3.7-buster, 3.6-buster -ARG VARIANT="3.11-bullseye" -FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT} +# [Choice] Python version (use -bookworm or -bullseye variants on local arm64/Apple Silicon): +# - 3, 3.12, 3.11, 3.10, 3.9, 3.8 +# - 3-bookworm, 3.12-bookworm, 3.11-bookworm, 3.10-bookworm, 3.9-bookworm, 3.8-bookworm +# - 3-bullseye, 3.12-bullseye, 3.11-bullseye, 3.10-bullseye, 3.9-bullseye, 3.8-bullseye +# - 3-buster, 3.12-buster, 3.11-buster, 3.10-buster, 3.9-buster, 3.8-buster +ARG VARIANT="3.12-bookworm" +FROM mcr.microsoft.com/vscode/devcontainers/python:1-${VARIANT} + +# Add "Poetry": https://python-poetry.org +ARG POETRY_HOME="/usr/local" +ENV POETRY_HOME="${POETRY_HOME}" +RUN set -ex; \ + \ + curl -sSL https://install.python-poetry.org | python3 -; \ + poetry self add poetry-plugin-up; # [Choice] Node.js version: none, lts/*, 18, 16, 14, 12, 10 ARG NODE_VERSION="none" @@ -34,5 +43,3 @@ RUN set -ex; \ # [Optional] Uncomment this line to install global node packages. # RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g " 2>&1 - -RUN su vscode -c "curl -sSL https://install.python-poetry.org | python3 -" 2>&1 diff --git a/api/.devcontainer/devcontainer.json b/api/.devcontainer/devcontainer.json index 428654b..030118d 100644 --- a/api/.devcontainer/devcontainer.json +++ b/api/.devcontainer/devcontainer.json @@ -9,7 +9,7 @@ // Update 'VARIANT' to pick a Python version. // Append -bullseye or -buster to pin to an OS version. // Use -bullseye variants on local on arm64/Apple Silicon. - // "VARIANT": "3.11-bullseye", + "VARIANT": "3.11-bookworm", // Options "NODE_VERSION": "none" } @@ -32,7 +32,7 @@ "mhutchie.git-graph", "ms-python.python", "ms-python.black-formatter", - // "ms-python.flake8", + "ms-python.flake8", "ms-python.isort", "ms-python.vscode-pylance" ] diff --git a/api/.vscode/settings.json b/api/.vscode/settings.json index aa67d94..0ca9fb2 100644 --- a/api/.vscode/settings.json +++ b/api/.vscode/settings.json @@ -1,7 +1,4 @@ { - "python.linting.enabled": true, - "python.linting.pylintEnabled": false, - "python.linting.flake8Enabled": true, "python.languageServer": "Pylance", "editor.formatOnSave": true, "[python]": { @@ -18,4 +15,6 @@ ], "python.testing.unittestEnabled": false, "python.testing.pytestEnabled": true, + "black-formatter.importStrategy": "fromEnvironment", + "flake8.importStrategy": "fromEnvironment", } \ No newline at end of file