From d84ef21f684732539da21d8571a0d2c0678a8f37 Mon Sep 17 00:00:00 2001 From: Brendon Smith Date: Mon, 5 Jul 2021 16:59:45 -0400 Subject: [PATCH] Update Poetry installs for Python 3.10 Poetry has a new install-poetry.py install script. The old get-poetry.py install script is not compatible with Python 3.10, so install-poetry.py will be used. install-poetry.py didn't respect `POETRY_VIRTUALENVS_CREATE=false` initially, but this issue appears to be resolved. Poetry was also erroring out with a `JSONDecodeError` when attempting to install packages on Python 3.10. This issue also appears to be resolved. Docker builds and GitHub Actions workflows will be updated to use `POETRY_HOME=/opt/poetry` consistently. --- .github/workflows/builds.yml | 8 ++++---- .github/workflows/hooks.yml | 8 ++++---- .github/workflows/tests.yml | 8 ++++---- Dockerfile | 4 ++-- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index 74584de..c6fcc5e 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -10,7 +10,7 @@ on: env: POETRY_HOME: /opt/poetry - POETRY_VERSION: 1.1.7 + POETRY_VERSION: 1.2.0a2 POETRY_VIRTUALENVS_CREATE: false jobs: @@ -40,9 +40,9 @@ jobs: restore-keys: ${{ runner.os }}-pre-commit- - name: Install Poetry run: | - curl -fsS -o get-poetry.py \ - "https://raw.githubusercontent.com/python-poetry/poetry/$POETRY_VERSION/get-poetry.py" - python get-poetry.py -y + curl -fsS -o install-poetry.py \ + "https://raw.githubusercontent.com/python-poetry/poetry/$POETRY_VERSION/install-poetry.py" + python install-poetry.py -y echo "$POETRY_HOME/bin" >> $GITHUB_PATH - name: Test Poetry version run: | diff --git a/.github/workflows/hooks.yml b/.github/workflows/hooks.yml index 25c5535..7283cbd 100644 --- a/.github/workflows/hooks.yml +++ b/.github/workflows/hooks.yml @@ -8,7 +8,7 @@ on: env: POETRY_HOME: /opt/poetry - POETRY_VERSION: 1.1.7 + POETRY_VERSION: 1.2.0a2 POETRY_VIRTUALENVS_CREATE: false jobs: @@ -38,9 +38,9 @@ jobs: restore-keys: ${{ runner.os }}-pre-commit- - name: Install Poetry run: | - curl -fsS -o get-poetry.py \ - "https://raw.githubusercontent.com/python-poetry/poetry/$POETRY_VERSION/get-poetry.py" - python get-poetry.py -y + curl -fsS -o install-poetry.py \ + "https://raw.githubusercontent.com/python-poetry/poetry/$POETRY_VERSION/install-poetry.py" + python install-poetry.py -y echo "$POETRY_HOME/bin" >> $GITHUB_PATH - name: Test Poetry version run: | diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4cd2c81..b9802ba 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -12,7 +12,7 @@ on: env: POETRY_HOME: /opt/poetry - POETRY_VERSION: 1.1.7 + POETRY_VERSION: 1.2.0a2 POETRY_VIRTUALENVS_CREATE: false jobs: @@ -35,9 +35,9 @@ jobs: restore-keys: ${{ runner.os }}-poetry- - name: Install Poetry run: | - curl -fsS -o get-poetry.py \ - "https://raw.githubusercontent.com/python-poetry/poetry/$POETRY_VERSION/get-poetry.py" - python get-poetry.py -y + curl -fsS -o install-poetry.py \ + "https://raw.githubusercontent.com/python-poetry/poetry/$POETRY_VERSION/install-poetry.py" + python install-poetry.py -y echo "$POETRY_HOME/bin" >> $GITHUB_PATH - name: Test Poetry version run: | diff --git a/Dockerfile b/Dockerfile index 070c97f..3c46302 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,9 +11,9 @@ ENV APP_MODULE=inboard.app.main_base:app LINUX_VERSION=$LINUX_VERSION PATH=/opt/ COPY poetry.lock pyproject.toml /app/ WORKDIR /app/ RUN sh -c 'if [ "$LINUX_VERSION" = "slim" ]; then apt-get update -qy && apt-get install -qy --no-install-recommends gcc libc-dev make wget; fi' && \ - wget -qO get-poetry.py "https://raw.githubusercontent.com/python-poetry/poetry/$POETRY_VERSION/get-poetry.py" && \ + wget -qO install-poetry.py "https://raw.githubusercontent.com/python-poetry/poetry/$POETRY_VERSION/install-poetry.py" && \ sh -c '. /etc/os-release; if [ "$ID" = "alpine" ]; then apk add --no-cache --virtual .build-deps gcc libc-dev make; fi' && \ - python get-poetry.py -y && poetry install --no-dev --no-interaction --no-root && \ + python install-poetry.py -y && poetry install --no-dev --no-interaction --no-root && \ sh -c 'if [ "$LINUX_VERSION" = "slim" ]; then apt-get purge --auto-remove -qy gcc libc-dev make wget; fi' && \ sh -c '. /etc/os-release; if [ "$ID" = "alpine" ]; then apk del .build-deps; fi' COPY inboard /app/inboard