Skip to content

Commit

Permalink
Update to the new Poetry install script (#293)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
thebeanogamer authored Oct 7, 2022
1 parent 44d6df8 commit 497ee22
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
16 changes: 8 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 497ee22

Please sign in to comment.