From bfdca038ea418eae707915632f8da8f778bc45ec Mon Sep 17 00:00:00 2001 From: Jordan Gillard Date: Sun, 14 Jul 2024 19:07:43 +0000 Subject: [PATCH] Update Dockerfile to install poetry and tox --- .devcontainer/Dockerfile | 21 +++++++++++++-------- .devcontainer/devcontainer.json | 3 +-- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 5bdba4d..4189ad8 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,16 +1,21 @@ FROM mcr.microsoft.com/vscode/devcontainers/base:ubuntu-20.04 +# Install all Python versions supported by EDGAR 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 \ + && add-apt-repository ppa:deadsnakes/ppa \ + && 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 + python3.12 python3.12-dev python3.12-venv curl + +# This installs pip from the primary version of Python we'll use +# for development +RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python3.12 -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 +# Install pipx, poetry, and tox +RUN python3.12 -m pip install --upgrade pip \ + && python3.12 -m pip install pipx \ + && python3.12 -m pipx ensurepath \ + && pipx install poetry tox diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index c2f62a5..4732109 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -17,7 +17,6 @@ ] } }, - "postCreateCommand": "python3 --version", - "forwardPorts": [], + "postCreateCommand": "python3 --version && poetry --version && tox --version", "remoteUser": "vscode" }