Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use new Poetry installer whenever possible #20

Merged
merged 1 commit into from
Sep 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
}