Skip to content

Commit

Permalink
Update Dockerfile to install poetry and tox
Browse files Browse the repository at this point in the history
  • Loading branch information
jordan-gillard committed Jul 14, 2024
1 parent 5e05d4b commit 9c6abf7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 10 deletions.
27 changes: 19 additions & 8 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,27 @@
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 install pip from the primary version of Python we'll use
# for development
RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python3.12

# 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

# Set the default Python version to 3.12
RUN ln -s /usr/bin/python3.12 /usr/bin/python3

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
# Sanity check that everything worked
RUN python3 --version && pip --version && poetry --version && tox --version
3 changes: 1 addition & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
]
}
},
"postCreateCommand": "python3 --version",
"forwardPorts": [],
"postCreateCommand": "python3 --version && poetry --version && tox --version",
"remoteUser": "vscode"
}

0 comments on commit 9c6abf7

Please sign in to comment.