Skip to content

Commit

Permalink
Add basic Python devcontainer configuration.
Browse files Browse the repository at this point in the history
This sets up a configuration for VS Code devcontainers.  Which allows anyone
with VS Code using the Dev Containers plugin to have a prescribed development
environment ready to go immediately with all needed dependencies.  This
configuration may be incomplete as it's just the initial configuration.
  • Loading branch information
alunduil authored and Flameeyes committed Dec 27, 2023
1 parent 6aa8bd7 commit ba6337a
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/python
{
"name": "Python 3",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/python:1-3.12-bullseye",
"features": {
"ghcr.io/devcontainers/features/git:1": {},
"ghcr.io/devcontainers/features/github-cli:1": {},
"ghcr.io/devcontainers-contrib/features/pre-commit:2": {}
},

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "pip3 install --user -r requirements.txt",
"customizations": {
"vscode": {
"extensions": [
"ms-python.vscode-pylance",
"ms-python.python"
]
}
}

// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
3 changes: 3 additions & 0 deletions .devcontainer/devcontainer.json.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2023 Alex Brandt

SPDX-License-Identifier: MIT
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ repos:
hooks:
- id: check-yaml
- id: check-json
exclude: '.devcontainer\.json'
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/pycqa/isort
Expand Down

0 comments on commit ba6337a

Please sign in to comment.