Skip to content

Commit

Permalink
support poetry v2 by conditionally setting some config options (#279)
Browse files Browse the repository at this point in the history
  • Loading branch information
ITProKyle authored Jan 7, 2025
1 parent 3656558 commit 8094ab2
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions scripts/install-poetry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,17 @@ case "${INPUT_POETRY_VERSION}" in
;;
esac

poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
poetry config virtualenvs.prefer-active-python true
poetry config virtualenvs.create true;
poetry config virtualenvs.in-project true;

__POETRY_VERSION="$(poetry --version | sed -E 's/.*([*-9+]\.[0-9]+\.[0-9+]([\.\-][^\s])?)\)?.*/\1/gm;t')"
__POETRY_VERSION_1_PATTERN="^1\..*"
if [[ "${__POETRY_VERSION}" =~ ${__POETRY_VERSION_1_PATTERN} ]]; then
poetry config virtualenvs.prefer-active-python true;
poetry config warnings.export false;
fi

pipx inject poetry poetry-plugin-export;
poetry config warnings.export false;

for plugin in ${INPUT_POETRY_PLUGINS}; do
pipx inject poetry "${plugin}";
Expand Down

0 comments on commit 8094ab2

Please sign in to comment.