From 0fbd40c7b406df5dfc34f28809e679f6d206eb1c Mon Sep 17 00:00:00 2001 From: SKairinos Date: Thu, 11 Jul 2024 10:39:21 +0000 Subject: [PATCH] single dev container --- .devcontainer.json | 49 ------------------- .vscode/codeforlife.code-snippets | 49 ------------------- .../autoDocstring/docstring.mustache | 35 ------------- .vscode/launch.json | 16 +++--- .vscode/settings.json | 17 +++---- .vscode/tasks.json | 33 ++++--------- codeforlife.code-workspace | 22 --------- 7 files changed, 23 insertions(+), 198 deletions(-) delete mode 100644 .devcontainer.json delete mode 100644 .vscode/codeforlife.code-snippets delete mode 100644 .vscode/extensions/autoDocstring/docstring.mustache delete mode 100644 codeforlife.code-workspace diff --git a/.devcontainer.json b/.devcontainer.json deleted file mode 100644 index 721570e..0000000 --- a/.devcontainer.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "customizations": { - "vscode": { - "extensions": [ - "visualstudioexptteam.vscodeintellicode", - "github.vscode-pull-request-github", - "redhat.vscode-yaml", - "davidanson.vscode-markdownlint", - "bierner.markdown-mermaid", - "streetsidesoftware.code-spell-checker", - "dbaeumer.vscode-eslint", - "ms-python.python", - "ms-python.debugpy", - "ms-python.pylint", - "ms-python.isort", - "ms-python.vscode-pylance", - "ms-python.mypy-type-checker", - "ms-python.black-formatter", - "qwtel.sqlite-viewer", - "njpwerner.autodocstring" - ] - } - }, - "dockerComposeFile": [ - "../docker-compose.yml" - ], - "features": { - "ghcr.io/devcontainers-contrib/features/pipenv:2": { - "version": "2023.11.15" - }, - "ghcr.io/devcontainers/features/node:1": { - "version": "18" - }, - "ghcr.io/devcontainers/features/python:1": { - "installTools": false, - "version": "3.8" - } - }, - "mounts": [ - "source=./codeforlife-package-javascript,target=/workspace/codeforlife-package-javascript,type=bind,consistency=cached", - "source=./codeforlife-package-python,target=/workspace/codeforlife-package-python,type=bind,consistency=cached" - ], - "name": "sso", - "postCreateCommand": "./setup", - "remoteUser": "root", - "service": "base-service", - "shutdownAction": "none", - "workspaceFolder": "/workspace/codeforlife-sso" -} \ No newline at end of file diff --git a/.vscode/codeforlife.code-snippets b/.vscode/codeforlife.code-snippets deleted file mode 100644 index e45c7bb..0000000 --- a/.vscode/codeforlife.code-snippets +++ /dev/null @@ -1,49 +0,0 @@ -{ - "javascript.module.doccomment": { - "body": [ - "/**", - " * \u00a9 Ocado Group", - " * Created on $CURRENT_DATE/$CURRENT_MONTH/$CURRENT_YEAR at $CURRENT_HOUR:$CURRENT_MINUTE:$CURRENT_SECOND($CURRENT_TIMEZONE_OFFSET).", - " *", - " * ${1:__description__}", - " */" - ], - "prefix": [ - "/" - ], - "scope": "javascript,typescript,javascriptreact,typescriptreact" - }, - "python.module.docstring": { - "body": [ - "\"\"\"", - "\u00a9 Ocado Group", - "Created on $CURRENT_DATE/$CURRENT_MONTH/$CURRENT_YEAR at $CURRENT_HOUR:$CURRENT_MINUTE:$CURRENT_SECOND($CURRENT_TIMEZONE_OFFSET).", - "", - "${1:__description__}", - "\"\"\"" - ], - "prefix": [ - "\"\"\"", - "'''" - ], - "scope": "python" - }, - "python.mypy.ignore": { - "body": [ - "# type: ignore[${1:__code_name__}]" - ], - "prefix": [ - "# type" - ], - "scope": "python" - }, - "python.pylint.disable-next": { - "body": [ - "# pylint: disable-next=${1:__code_name__}" - ], - "prefix": [ - "# pylint" - ], - "scope": "python" - } -} \ No newline at end of file diff --git a/.vscode/extensions/autoDocstring/docstring.mustache b/.vscode/extensions/autoDocstring/docstring.mustache deleted file mode 100644 index 64a5b91..0000000 --- a/.vscode/extensions/autoDocstring/docstring.mustache +++ /dev/null @@ -1,35 +0,0 @@ -{{! Based off of: https://github.com/NilsJPWerner/autoDocstring/blob/master/src/docstring/templates/google-notypes.mustache }} -{{summaryPlaceholder}} - -{{extendedSummaryPlaceholder}} -{{#parametersExist}} - -Args: -{{#args}} - {{var}}: {{descriptionPlaceholder}} -{{/args}} -{{#kwargs}} - {{var}}: {{descriptionPlaceholder}} -{{/kwargs}} -{{/parametersExist}} -{{#exceptionsExist}} - -Raises: -{{#exceptions}} - {{type}}: {{descriptionPlaceholder}} -{{/exceptions}} -{{/exceptionsExist}} -{{#returnsExist}} - -Returns: -{{#returns}} - {{descriptionPlaceholder}} -{{/returns}} -{{/returnsExist}} -{{#yieldsExist}} - -Yields: -{{#yields}} - {{descriptionPlaceholder}} -{{/yields}} -{{/yieldsExist}} \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json index 898e1c0..edcba5c 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -9,6 +9,9 @@ "type": "debugpy" }, { + "env": { + "PYTEST_ADDOPTS": "--no-cov" + }, "justMyCode": false, "name": "Pytest", "presentation": { @@ -17,17 +20,10 @@ "request": "test", "type": "debugpy" }, - { - "name": "React Dev Server", - "preLaunchTask": "start-react-dev-server", - "request": "launch", - "type": "chrome", - "url": "http://localhost:3000" - }, { "args": [ "runserver", - "localhost:8001" + "localhost:8000" ], "django": true, "env": { @@ -36,8 +32,8 @@ }, "justMyCode": false, "name": "Django Server", - "preLaunchTask": "migrate-db", - "program": "${workspaceFolder}/backend/manage.py", + "preLaunchTask": "setup", + "program": "${workspaceFolder}/manage.py", "request": "launch", "type": "debugpy" } diff --git a/.vscode/settings.json b/.vscode/settings.json index 765e605..4b1e620 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -10,7 +10,6 @@ "--config", "pyproject.toml" ], - "black-formatter.cwd": "${workspaceFolder}/backend", "black-formatter.path": [ ".venv/bin/python", "-m", @@ -38,17 +37,16 @@ "**/__pycache__": true }, "isort.args": [ - "--settings-file=backend/pyproject.toml" + "--settings-file=pyproject.toml" ], "isort.path": [ - "backend/.venv/bin/python", + ".venv/bin/python", "-m", "isort" ], "mypy-type-checker.args": [ "--config-file=pyproject.toml" ], - "mypy-type-checker.cwd": "${workspaceFolder}/backend", "mypy-type-checker.path": [ ".venv/bin/python", "-m", @@ -57,7 +55,6 @@ "pylint.args": [ "--rcfile=pyproject.toml" ], - "pylint.cwd": "${workspaceFolder}/backend", "pylint.path": [ ".venv/bin/python", "-m", @@ -66,14 +63,14 @@ "python.analysis.extraPaths": [ "../codeforlife-package-python" ], - "python.defaultInterpreterPath": "backend/.venv/bin/python", - "python.testing.cwd": "${workspaceFolder}/backend", + "python.defaultInterpreterPath": ".venv/bin/python", "python.testing.pytestArgs": [ "-n=auto", + "--cov=api", + "--cov-report=html", "-c=pyproject.toml", - "." + "api" ], "python.testing.pytestEnabled": true, - "python.testing.unittestEnabled": false, - "typescript.preferences.quoteStyle": "single" + "python.testing.unittestEnabled": false } \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json index ed804e8..2f3d8cd 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -1,35 +1,22 @@ { "tasks": [ { - "isBackground": true, - "label": "start-react-dev-server", - "options": { - "env": { - "BROWSER": "none" - } - }, - "path": "frontend", + "command": "sudo chmod u+x scripts/setup && scripts/setup", + "label": "setup", "problemMatcher": [], - "script": "start", - "type": "npm" + "type": "shell" }, { - "command": "pipenv install --dev", - "label": "pipenv-install-dev", - "options": { - "cwd": "${workspaceFolder}/backend" - }, + "command": "sudo chmod u+x scripts/hard-install && scripts/hard-install", + "label": "hard-install", + "problemMatcher": [], "type": "shell" }, { - "command": "pipenv run python ./manage.py migrate", - "dependsOn": [ - "pipenv-install-dev" - ], - "label": "migrate-db", - "options": { - "cwd": "${workspaceFolder}/backend" - }, + "command": "sudo chmod u+x scripts/run && scripts/run", + "isBackground": true, + "label": "run", + "problemMatcher": [], "type": "shell" } ], diff --git a/codeforlife.code-workspace b/codeforlife.code-workspace deleted file mode 100644 index cf2fcba..0000000 --- a/codeforlife.code-workspace +++ /dev/null @@ -1,22 +0,0 @@ -{ - "folders": [ - { - "name": "sso", - "path": "." - }, - { - "name": "package-python", - "path": "../codeforlife-package-python" - }, - { - "name": "package-javascript", - "path": "../codeforlife-package-javascript" - } - ], - "settings": { - "autoDocstring.customTemplatePath": ".vscode/extensions/autoDocstring/docstring.mustache", - "workbench.colorCustomizations": { - "editorRuler.foreground": "#008000" - } - } -} \ No newline at end of file