Skip to content

Commit

Permalink
Merge pull request #20 from Kurt-von-Laven/prefer-new-installer
Browse files Browse the repository at this point in the history
Use new Poetry installer whenever possible
  • Loading branch information
crflynn authored Sep 1, 2022
2 parents 5659450 + 89e3949 commit 2115a14
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
6 changes: 2 additions & 4 deletions bin/install
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,9 @@ install_poetry() {
fail "asdf-poetry supports release installs only"
fi

semver_ge "$ASDF_INSTALL_VERSION" 1.2.0 && vercomp="ge" || vercomp="lt"

if [[ -n ${ASDF_POETRY_INSTALL_URL:-} ]]; then
install_url=$ASDF_POETRY_INSTALL_URL
elif [ $vercomp == "ge" ]; then
elif semver_ge "$ASDF_INSTALL_VERSION" 1.1.7; then
install_url="https://install.python-poetry.org"
else
install_url="https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py"
Expand All @@ -48,7 +46,7 @@ install_poetry() {

curl -sSL "$install_url" | POETRY_HOME=$install_path python3 - --version "$version" $flags

if [ $vercomp == "ge" ]; then
if semver_ge "$ASDF_INSTALL_VERSION" 1.2.0; then
# Ensure that poetry behaves as expected with asdf python (pyenv)
echo Configuring poetry to behave properly with asdf ...
echo Running: \"poetry config virtualenvs.prefer-active-python true\".
Expand Down
8 changes: 4 additions & 4 deletions test/install.bats
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
echo "$output" | grep "supports release installs only"
}

@test "install works on version before 1.2" {
run asdf install poetry 1.1.7
@test "install works on version before 1.1.7" {
run asdf install poetry 1.1.6
[ "$status" -eq 0 ]
echo "$output" | grep "This installer is deprecated"
}

@test "install works on version after 1.2" {
run asdf install poetry 1.2.0
@test "install works on version after 1.1.7" {
run asdf install poetry 1.1.7
[ "$status" -eq 0 ]
echo "$output" | grep -v "This installer is deprecated"
}

0 comments on commit 2115a14

Please sign in to comment.