Skip to content

Commit

Permalink
✨ Add devcontainer (microsoft#1085)
Browse files Browse the repository at this point in the history
* ✨ 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
  • Loading branch information
julien-blanchon authored Mar 2, 2024
1 parent f8faf9f commit fe33e6c
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -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"]
}
}
}
}

0 comments on commit fe33e6c

Please sign in to comment.