diff --git a/Install.ps1 b/Install.ps1 index 0d2e40c565..535528a121 100644 --- a/Install.ps1 +++ b/Install.ps1 @@ -102,10 +102,7 @@ foreach ($extra in $extras) $extras_cli += $extra } -if (-not (Get-Item -ErrorAction SilentlyContinue ".penv/Scripts/poetry.exe").Exists) -{ - ./Setup-poetry.ps1 -pythonVersion "$pythonVersion" -} +./Setup-poetry.ps1 -pythonVersion "$pythonVersion" .penv/Scripts/poetry env use $(py -"$pythonVersion" -c 'import sys; print(sys.executable)') .penv/Scripts/poetry install @extras_cli diff --git a/Setup-poetry.ps1 b/Setup-poetry.ps1 index 1b8fb305c1..b841f3f015 100644 --- a/Setup-poetry.ps1 +++ b/Setup-poetry.ps1 @@ -6,7 +6,10 @@ param( $ErrorActionPreference = "Stop" -py -$pythonVersion -m venv .penv -.penv/Scripts/python -m pip install --upgrade pip setuptools wheel +if (-not (Get-Item -ErrorAction SilentlyContinue ".penv/Scripts/").Exists) +{ + py -$pythonVersion -m venv .penv + .penv/Scripts/python -m pip install --upgrade pip +} # TODO: maybe make our own zipapp/shiv/pex of poetry and download that? -.penv/Scripts/python -m pip install --requirement requirements-poetry.txt +.penv/Scripts/python -m pip install --upgrade --requirement requirements-poetry.txt diff --git a/install.sh b/install.sh index 516e6e0845..240ec9ab0c 100755 --- a/install.sh +++ b/install.sh @@ -168,9 +168,7 @@ if [ "$OPENSSL_VERSION_INT" -lt "269488367" ]; then echo "Your OS may have patched OpenSSL and not updated the version to 1.1.1n" fi -if [ ! -f .penv/bin/poetry ]; then - ./setup-poetry.sh -c "${INSTALL_PYTHON_PATH}" -fi +./setup-poetry.sh -c "${INSTALL_PYTHON_PATH}" .penv/bin/poetry env use "${INSTALL_PYTHON_PATH}" # shellcheck disable=SC2086 diff --git a/setup-poetry.sh b/setup-poetry.sh index 76339613be..f90056371b 100755 --- a/setup-poetry.sh +++ b/setup-poetry.sh @@ -30,7 +30,9 @@ while getopts c:h flag; do esac done -"$PYTHON_COMMAND" -m venv .penv -.penv/bin/python -m pip install --upgrade pip setuptools wheel +if [ ! -d .penv/bin/ ]; then + "$PYTHON_COMMAND" -m venv .penv + .penv/bin/python -m pip install --upgrade pip +fi # TODO: maybe make our own zipapp/shiv/pex of poetry and download that? -.penv/bin/python -m pip install --requirement requirements-poetry.txt +.penv/bin/python -m pip install --upgrade --requirement requirements-poetry.txt