Skip to content

Commit

Permalink
feat(poetry): use new installer (#124)
Browse files Browse the repository at this point in the history
* feat(poetry): use new installer

* fix: use new installer

* fix: update installer

* test: add test's

* fix: add poetry workaround

fixes #123
  • Loading branch information
viceice authored Aug 30, 2021
1 parent 8aa4457 commit 9aab7e7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
13 changes: 10 additions & 3 deletions src/usr/local/buildpack/tools/poetry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ if [[ ! "${MAJOR}" || ! "${MINOR}" || ! "${PATCH}" ]]; then
exit 1
fi

POETRY_URL=https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py
POETRY_URL=https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py

tool_path=$(find_tool_path)

function update_env () {
Expand All @@ -25,11 +26,17 @@ if [[ -z "${tool_path}" ]]; then

mkdir -p ${tool_path}

curl -sSL $POETRY_URL | python - --version ${TOOL_VERSION} --no-modify-path
curl -sSL $POETRY_URL | python - --version ${TOOL_VERSION}
unset POETRY_HOME

# fix execute for all [#150]
# fix execute for all renovatebot/docker-buildpack#150
chmod +x ${tool_path}/bin/poetry

# fix uid/ fid #124
if [[ $UID -eq 0 ]]; then
[ -f "${tool_path}/lib/poetry/_vendor/py2.7/backports/entry_points_selectable.py" ] \
&& chown 0:0 ${tool_path}/lib/poetry/_vendor/py2.7/backports/entry_points_selectable.py
fi
fi

update_env ${tool_path}
Expand Down
9 changes: 5 additions & 4 deletions test/python/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,12 @@ RUN set -ex; cd test/d-poetry && poetry update --lock --no-interaction pytest


#--------------------------------------
# test e: poetry
# test e: poetry (old versions)
#--------------------------------------
FROM poetry as teste

FROM build as teste

RUN install-tool poetry 0.12.17
RUN install-tool poetry 1.1.0

#--------------------------------------
# test f: pip_requirements
Expand Down Expand Up @@ -153,6 +154,6 @@ COPY --from=testa /.dummy /.dummy
COPY --from=testb /.dummy /.dummy
COPY --from=testc /.dummy /.dummy
COPY --from=testd /.dummy /.dummy
# COPY --from=teste /.dummy /.dummy
COPY --from=teste /.dummy /.dummy
COPY --from=testf /.dummy /.dummy
COPY --from=testg /.dummy /.dummy

0 comments on commit 9aab7e7

Please sign in to comment.