Skip to content

Commit

Permalink
fix: poetry@2 venv syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Jan 6, 2025
1 parent 0bb2c1c commit f2fe51c
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions bin/install
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ install_poetry() {
if [ "$install_type" == "version" ]; then
semver_ge "$MISE_INSTALL_VERSION" 1.1.7 && install_vercomp="ge" || install_vercomp="lt"
semver_ge "$MISE_INSTALL_VERSION" 1.2.0 && config_vercomp="ge" || config_vercomp="lt"
semver_ge "$MISE_INSTALL_VERSION" 2.0.0 && venv_vercomp="ge" || venv_vercomp="lt"
else
install_vercomp="ge"
config_vercomp="lt"
venv_vercomp="lt"
fi

if [[ -n ${MISE_POETRY_INSTALL_URL:-} ]]; then
Expand All @@ -53,10 +55,15 @@ install_poetry() {

if [ "$config_vercomp" == "ge" ]; then
# Ensure that poetry behaves as expected with mise python (pyenv)
echo Configuring poetry to behave properly with mise ...
echo Running: \"poetry config virtualenvs.prefer-active-python true\".
echo ""
"$install_path"/bin/poetry config virtualenvs.prefer-active-python true
if [ "$venv_vercomp" == "ge" ]; then
echo Running: \"poetry config virtualenvs.use-poetry-python true\".
echo ""
"$install_path"/bin/poetry config virtualenvs.use-poetry-python true
else
echo Running: \"poetry config virtualenvs.prefer-active-python true\".
echo ""
"$install_path"/bin/poetry config virtualenvs.prefer-active-python true
fi
else
echo Warning: Poetry versions prior to 1.2.0 may not work properly with mise.
echo Consider upgrading to a later version.
Expand Down

0 comments on commit f2fe51c

Please sign in to comment.