From ce7a8ddde0a5bd822e677899ef257f4aa6f4c1ae Mon Sep 17 00:00:00 2001 From: Yuming Zhu Date: Oct 21 2024 13:53:56 +0000 Subject: vscode devcontainers --- diff --git a/.devcontainer/on_create.sh b/.devcontainer/on_create.sh new file mode 100755 index 0000000..62b8e54 --- /dev/null +++ b/.devcontainer/on_create.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +set -e + +PIP_CMD=${PIP_CMD:=pip3} + +echo ". /usr/share/git-core/contrib/completion/git-prompt.sh" >> ~/.bashrc +echo "export PS1='[\[\e[34m\]\W\[\e[35m\]\$(__git_ps1 \" %s\")\[\e[00m\]]$\[\e[00m\] '" >> ~/.bashrc + +$PIP_CMD install -r requirements.txt diff --git a/.devcontainer/python2/devcontainer.json b/.devcontainer/python2/devcontainer.json new file mode 100644 index 0000000..82c670d --- /dev/null +++ b/.devcontainer/python2/devcontainer.json @@ -0,0 +1,29 @@ +// 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": "centos7-python2-devel", + + // "image": "quay.io/centos/centos:7", + "build": { + "dockerfile": "../../devtools/containers/Dockerfile.centos7", + "args": { + "EXTRA_PKGS": "git vim make" + } + }, + + "shutdownAction": "stopContainer", + + "postCreateCommand": "PIP_CMD=pip bash .devcontainer/on_create.sh", + + "remoteUser": "root", + + "customizations": { + "vscode": { + "extensions": [ + "ms-python.python", + "ms-python.vscode-pylance", + "ms-python.isort" + ] + } + } +} diff --git a/.devcontainer/python3/devcontainer.json b/.devcontainer/python3/devcontainer.json new file mode 100644 index 0000000..81a8b08 --- /dev/null +++ b/.devcontainer/python3/devcontainer.json @@ -0,0 +1,28 @@ +// 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": "fedora-python3-devel", + // "image": "quay.io/fedora/fedora:latest", + "build": { + "dockerfile": "../../devtools/containers/Dockerfile.f39", + "args": { + "EXTRA_PKGS": "git vim make python3-pip" + } + }, + + "shutdownAction": "stopContainer", + + "postCreateCommand": "PIP_CMD=pip3 bash .devcontainer/on_create.sh", + + "remoteUser": "root", + + "customizations": { + "vscode": { + "extensions": [ + "ms-python.python", + "ms-python.vscode-pylance", + "ms-python.isort" + ] + } + } +}