Skip to content

Commit

Permalink
Read Poetry version from poetry.lock
Browse files Browse the repository at this point in the history
  • Loading branch information
jacebrowning committed Aug 19, 2023
1 parent b749315 commit bbb1334
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions bin/compile
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,13 @@ for env_file in $BUILDPACK_VARIABLES ; do
done

if [ -z "${POETRY_VERSION:-}" ] ; then
export POETRY_VERSION=1.5.1
log "No Poetry version specified in POETRY_VERSION config var. Defaulting to $POETRY_VERSION."
export POETRY_VERSION=$(grep -oP '(?<=generated by Poetry )\d+(\.\d+)*' poetry.lock)
if [ -z "$POETRY_VERSION" ] ; then
export POETRY_VERSION=1.5.1
log "No Poetry version found in poetry.lock. Defaulting to $POETRY_VERSION."
else
log "Using Poetry version from poetry.lock: $POETRY_VERSION"
fi
else
log "Using Poetry version from POETRY_VERSION config var: $POETRY_VERSION"
fi
Expand Down

0 comments on commit bbb1334

Please sign in to comment.