From cac36c8183d6f3dc4e5dd47492f3d66bb5ef29b1 Mon Sep 17 00:00:00 2001 From: Ben Date: Sun, 19 Oct 2025 18:29:48 -0400 Subject: [PATCH] feat: add devcontainer configuration and setup script for development environment --- .devcontainer/devcontainer.json | 58 +++++++++++++++++++++++++++++++++ .devcontainer/setup.sh | 17 ++++++++++ 2 files changed, 75 insertions(+) create mode 100644 .devcontainer/devcontainer.json create mode 100755 .devcontainer/setup.sh diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..a22d29e --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,58 @@ +{ + "name": "Datawrapper Python Development", + "image": "mcr.microsoft.com/devcontainers/python:3.12", + + "features": { + "ghcr.io/devcontainers/features/git:1": {}, + "ghcr.io/devcontainers/features/github-cli:1": {} + }, + + "customizations": { + "vscode": { + "extensions": [ + "ms-python.python", + "ms-python.vscode-pylance", + "charliermarsh.ruff", + "ms-python.pytest", + "ms-toolsai.jupyter" + ], + + "settings": { + "python.defaultInterpreterPath": "/usr/local/bin/python", + "python.testing.pytestEnabled": true, + "python.testing.unittestEnabled": false, + "python.testing.pytestArgs": [ + "tests" + ], + "[python]": { + "editor.defaultFormatter": "charliermarsh.ruff", + "editor.formatOnSave": true, + "editor.codeActionsOnSave": { + "source.fixAll": "explicit", + "source.organizeImports": "explicit" + } + }, + "files.exclude": { + "**/__pycache__": true, + "**/*.pyc": true, + "**/.pytest_cache": true, + "**/.ruff_cache": true, + "**/htmlcov": true, + "**/*.egg-info": true + } + } + } + }, + + "forwardPorts": [8000], + "portsAttributes": { + "8000": { + "label": "Documentation Server", + "onAutoForward": "notify" + } + }, + + "postCreateCommand": "bash .devcontainer/setup.sh", + + "shutdownAction": "stopContainer" +} diff --git a/.devcontainer/setup.sh b/.devcontainer/setup.sh new file mode 100755 index 0000000..6a42488 --- /dev/null +++ b/.devcontainer/setup.sh @@ -0,0 +1,17 @@ +#!/bin/bash +set -e + +echo "🚀 Setting up Datawrapper development environment..." + +# Install uv package manager +echo "📦 Installing uv package manager..." +curl -LsSf https://astral.sh/uv/install.sh | sh +export PATH="$HOME/.cargo/bin:$PATH" + +# Install all project dependencies +echo "📚 Installing project dependencies..." +uv install --all-extras + +# Install pre-commit hooks +echo "🔧 Installing pre-commit hooks..." +uv run pre-commit install