From d995d3a2620a896e0eb726b0c58c39d0e81041ef Mon Sep 17 00:00:00 2001 From: Christophe Dervieux Date: Fri, 6 Dec 2024 17:36:04 +0100 Subject: [PATCH 1/2] tests - prefer setup using uv --- tests/configure-test-env.ps1 | 14 +++----------- tests/configure-test-env.sh | 27 +++++++++------------------ 2 files changed, 12 insertions(+), 29 deletions(-) diff --git a/tests/configure-test-env.ps1 b/tests/configure-test-env.ps1 index 2cb9d262f3c..d005ddda8fa 100644 --- a/tests/configure-test-env.ps1 +++ b/tests/configure-test-env.ps1 @@ -14,22 +14,14 @@ If ($r) { # Check python test environment --- Write-Host -ForegroundColor green ">>>> Configuring python environment" -try { $null = gcm py -ea stop; $py=$true} catch { - Write-Host -ForegroundColor red "Missing Python launcher - py.exe is required on Windows - it should be installed with Python for Windows." +try { $null = gcm uv -ea stop; $uv=$true } catch { + Write-Host -ForegroundColor red "No uv found in PATH - Install uv please: https://docs.astral.sh/uv/getting-started/installation/" } -try { $null = gcm python -ea stop; $python=$true } catch { - Write-Host -ForegroundColor red "No python found in PATH - Check your PATH or install python add to PATH." -} - -If ( $py -and $python) { +If ($uv) { Write-Host "Setting up python environnement with uv" - try { $null = gcm uv -ea stop; $uv=$true } catch { - Write-Host -ForegroundColor red "No uv found in PATH - Install uv please: https://docs.astral.sh/uv/getting-started/installation/" - } # install from lockfile uv sync --frozen - $uv=$true } # Check Julia environment --- diff --git a/tests/configure-test-env.sh b/tests/configure-test-env.sh index ebf7590d008..e0d9ce21284 100755 --- a/tests/configure-test-env.sh +++ b/tests/configure-test-env.sh @@ -17,25 +17,16 @@ fi # Check python test environment --- echo ">>>> Configuring Python environment" -python_exists=$(command -v python) -if [ -z $python_exists ] -then - python_exists=$(command -v python3) - if [ -z python_exists ] - then - echo "No python found in PATH - Check your PATH or install python add to PATH." - fi -fi -if [ -n $python_exists ] +# Prefer uv is available +uv_exist=$(command -v uv) +if [ -z $uv_exist ] then - uv_exist=$(command -v uv) - if [ -z $uv_exist ] - echo "Setting up python environnement with uv" - # create or sync the virtual env in the project - uv sync --frozen - then - echo "No uv found - Install uv please: https://docs.astral.sh/uv/getting-started/installation/" - fi + echo "Setting up python environnement with uv" + # create or sync the virtual env in the project + uv sync --frozen +else + echo "No uv found - Install uv please: https://docs.astral.sh/uv/getting-started/installation/." + echo "Using 'uv' is the prefered way. You can still use python and create a .venv in the project." fi # Check Julia environment --- From c5b7da6de969389cf1b690336755925784e0e736 Mon Sep 17 00:00:00 2001 From: Christophe Dervieux Date: Fri, 6 Dec 2024 17:39:50 +0100 Subject: [PATCH 2/2] Update uv --- .github/workflows/test-smokes.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-smokes.yml b/.github/workflows/test-smokes.yml index 2264edf20ce..80f301c439b 100644 --- a/.github/workflows/test-smokes.yml +++ b/.github/workflows/test-smokes.yml @@ -143,7 +143,7 @@ jobs: - name: Install uv for Python uses: astral-sh/setup-uv@v3 with: - version: "0.4.30" + version: "0.5.6" enable-cache: true cache-dependency-glob: "tests/uv.lock"