diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000000..16fa9aa56c --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,8 @@ +# [Choice] Python version (use -bookworm or -bullseye variants on local arm64/Apple Silicon): 3, 3.11, 3.10, 3.9, 3.8, 3-bookworm, 3.11-bookworm, 3.10-bookworm, 3.9-bookworm, 3.8-bookworm, 3-bullseye, 3.11-bullseye, 3.10-bullseye, 3.9-bullseye, 3.8-bullseye, 3-buster, 3.11-buster, 3.10-buster, 3.9-buster, 3.8-buster +ARG VARIANT=3-bookworm +FROM python:${VARIANT} + +RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ + && apt-get purge -y fish + +RUN python3 -m pip install --upgrade setuptools cython pip poetry diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000000..bccc3c0030 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,70 @@ +{ + "name": "litestar-org/litestar", + "build": { + "dockerfile": "./Dockerfile", + "context": "." + }, + "features": { + "ghcr.io/devcontainers/features/common-utils:2": { + "installZsh": "true", + "username": "vscode", + "userUid": "1000", + "userGid": "1000", + "upgradePackages": "true" + }, + "ghcr.io/devcontainers/features/github-cli:1": {}, + "ghcr.io/devcontainers-contrib/features/pre-commit:2": {}, + "ghcr.io/devcontainers/features/python:1": "none", + "ghcr.io/devcontainers/features/git:1": { + "version": "latest", + "ppa": "false" + } + }, + "customizations": { + "codespaces": { + "openFiles": ["CONTRIBUTING.rst"] + }, + "vscode": { + "extensions": [ + "mhutchie.git-graph", + "eamodio.gitlens", + "github.vscode-github-actions", + "ms-python.black-formatter", + "ms-python.mypy-type-checker", + "charliermarsh.ruff" + ], + "settings": { + "python.editor.defaultFormatter": "ms-python.black-formatter", + "python.defaultInterpreterPath": "${workspaceFolder}/.venv", + "python.terminal.activateEnvInCurrentTerminal": true, + "python.testing.unittestEnabled": false, + "python.testing.pytestEnabled": true, + "python.testing.pytestArgs": ["."], + "python.terminal.launchArgs": ["-X", "dev"], + "terminal.integrated.shell.linux": "/bin/bash", + "terminal.integrated.profiles.linux": { + "bash": { + "path": "bash", + "icon": "terminal-bash" + }, + "zsh": { + "path": "zsh" + }, + "fish": { + "path": "fish" + } + } + } + } + }, + "forwardPorts": [8000], + "postCreateCommand": [ + "poetry", + "install", + "--extras", + "full", + "--with", + "docs,lint" + ], + "remoteUser": "vscode" +}