From 5e05d4bc17081281abc140a2d9a5f007ab94f3b1 Mon Sep 17 00:00:00 2001 From: Jordan Gillard Date: Sun, 14 Jul 2024 18:16:30 +0000 Subject: [PATCH] config: Add codespaces config w/ Python versions --- .devcontainer/Dockerfile | 16 ++++++++++++++++ .devcontainer/devcontainer.json | 23 +++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..5bdba4d --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,16 @@ +FROM mcr.microsoft.com/vscode/devcontainers/base:ubuntu-20.04 + +RUN apt-get update && apt-get install -y \ + software-properties-common \ + && add-apt-repository ppa:deadsnakes/ppa + +RUN apt-get update && apt-get install -y \ + python3.9 python3.9-dev python3.9-venv \ + python3.10 python3.10-dev python3.10-venv \ + python3.11 python3.11-dev python3.11-venv \ + python3.12 python3.12-dev python3.12-venv + +RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 1 \ + && update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 2 \ + && update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 3 \ + && update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 4 diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..c2f62a5 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,23 @@ +{ + "name": "Python Dev Container", + "build": { + "dockerfile": "Dockerfile" + }, + "customizations": { + "vscode": { + "settings": { + "python.defaultInterpreterPath": "/usr/bin/python3.12" + }, + "extensions": [ + "ms-python.python", + "ms-python.vscode-pylance", + "ms-python.debugpy", + "ms-azuretools.vscode-docker", + "mechatroner.rainbow-csv" + ] + } + }, + "postCreateCommand": "python3 --version", + "forwardPorts": [], + "remoteUser": "vscode" +}