Skip to content

Commit

Permalink
Update Poetry installs for Python 3.10
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
br3ndonland committed Sep 19, 2021
1 parent ec860e2 commit d84ef21
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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: |
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/hooks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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: |
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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: |
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d84ef21

Please sign in to comment.