From 497ee227ba2af674191f3ee2871fed1e0a781f76 Mon Sep 17 00:00:00 2001 From: Daniel Milnes Date: Fri, 7 Oct 2022 21:19:11 +0100 Subject: [PATCH] Update to the new Poetry install script (#293) * Update to the new Poetry install script Builds are currently broken as we refer to the old install script (which Poetry have broken to make you stop using it). This patch puts us onto the new one and fixes things. * Add convert the unit tests --- .github/workflows/docs.yml | 6 +++--- .github/workflows/test.yml | 6 +++--- Dockerfile | 16 ++++++++-------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 10ce50a9..a6b3c1fa 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -78,13 +78,13 @@ jobs: ${{ runner.os }}- - name: Install Poetry - run: curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python + run: curl -sSL https://install.python-poetry.org | python3 - - name: Disable Virtualenvs - run: $HOME/.poetry/bin/poetry config virtualenvs.create false + run: $HOME/.local/bin/poetry config virtualenvs.create false - name: Install Python Dependencies - run: $HOME/.poetry/bin/poetry install --no-interaction --no-ansi + run: $HOME/.local/bin/poetry install --no-interaction --no-ansi env: PIP_CACHE_DIR: ~/.pip diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a268ed75..516690b4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,13 +29,13 @@ jobs: ${{ runner.os }}- - name: Install Poetry - run: curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python + run: curl -sSL https://install.python-poetry.org | python3 - - name: Disable Virtualenvs - run: $HOME/.poetry/bin/poetry config virtualenvs.create false + run: $HOME/.local/bin/poetry config virtualenvs.create false - name: Install Python Dependencies - run: $HOME/.poetry/bin/poetry install --no-interaction --no-ansi + run: $HOME/.local/bin/poetry install --no-interaction --no-ansi env: PIP_CACHE_DIR: ~/.pip diff --git a/Dockerfile b/Dockerfile index 3661683d..72a0d5f2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,20 +2,20 @@ FROM docker.io/library/python:3.9-slim ARG BUILD_DEPS="build-essential" +WORKDIR /app/ + +ENV PYTHONUNBUFFERED=1 \ + PIP_NO_CACHE_DIR=off \ + PYTHONPYCACHEPREFIX=/tmp \ + PATH=/root/.local/bin:/app/src/manage.py${PATH} + RUN set -ex \ && apt-get update && apt-get -y --no-install-recommends install $BUILD_DEPS libpq-dev netcat make git curl \ && rm -rf /var/lib/apt/lists/* \ - && curl -sSL "https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py" | python \ - && . $HOME/.poetry/env \ + && curl -sSL https://install.python-poetry.org | python3 - \ && poetry config virtualenvs.create false COPY poetry.lock pyproject.toml /app/ -WORKDIR /app/ - -ENV PYTHONUNBUFFERED=1 \ - PIP_NO_CACHE_DIR=off \ - PYTHONPYCACHEPREFIX=/tmp \ - PATH=/root/.poetry/bin:/app/src/manage.py${PATH} RUN poetry install --no-root --no-interaction \ && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $BUILD_DEPS