From 2a6b4bd802ff0b00728c2b17aafd9e8cb06f923b Mon Sep 17 00:00:00 2001 From: Blanchon Date: Sat, 2 Mar 2024 22:53:34 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Add=20devcontainer=20(#1085)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ✨ Add devcontainer * 🐛 Add postCreateCommand.sh * Downgrade to Python 3.10 * Add gdal * Separate CPU/GPU devcontainer.json * Add cpu as default * Rename default * In order to enable vscode black auto format, color must be disable ! * Remove default root devcontainer * Format and clean * Switch to .[dataset ...] * Add postStartCommand with pip install -e . * Fix black * Update * Mise à jour des commandes postCreateCommand et postStartCommand dans devcontainer.json * 🔥 Add devcontainer * Update Python version and postStartCommand in devcontainer.json --- .devcontainer/devcontainer.json | 52 +++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000000..97f2eb2e660 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,52 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +{ + "name": "Torchgeo DevContainer", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "image": "mcr.microsoft.com/devcontainers/python:3.12", + + // Features to add to the dev container. More info: https://containers.dev/features. + "features": { + "ghcr.io/devcontainers/features/git:1": { "version": "os-provided" } + }, + + // "postCreateCommand": "", + "postStartCommand": "pip install -e .[all]", + + // Enable GPU support + "hostRequirements": { + "gpu": "optional" + }, + + "customizations": { + "vscode": { + "extensions": [ + "ms-python.python", + "ms-python.isort", + "ms-python.black-formatter", + "ms-python.vscode-pylance", + "ms-python.pylint", + "ms-python.flake8", + "ms-python.mypy-type-checker", + "GitHub.codespaces", + "ms-toolsai.jupyter" + ], + "settings": { + "telemetry.telemetryLevel": "off", + "python.languageServer": "Pylance", + "python.defaultInterpreterPath": "/usr/local/bin/python", + "python.formatting.blackPath": "/usr/local/py-utils/bin/black", + "python.testing.pytestEnabled": true, + "python.testing.pytestPath": "/usr/local/py-utils/bin/pytest", + "python.editor.formatOnSave": true, + "python.editor.formatOnSaveMode": "file", + "python.editor.formatOnPaste": false, + "python.editor.codeActionsOnSave": { + "source.organizeImports": true + }, + "python.diffEditor.wordWrap": "off", + "isort.args": ["--profile", "black"], + "isort.path": ["/home/vscode/.local/bin/isort"] + } + } + } +}