Skip to content

Commit

Permalink
config: Add codespaces config w/ Python versions
Browse files Browse the repository at this point in the history
  • Loading branch information
jordan-gillard committed Jul 14, 2024
1 parent 20c5d58 commit 5e05d4b
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
23 changes: 23 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -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"
}

0 comments on commit 5e05d4b

Please sign in to comment.