Skip to content

Commit f1de7a2

Browse files
authored
Merge pull request #11625 from quarto-dev/tests/prefer-uv
Tests/prefer uv
2 parents 80ba28d + c5b7da6 commit f1de7a2

File tree

3 files changed

+13
-30
lines changed

3 files changed

+13
-30
lines changed

.github/workflows/test-smokes.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ jobs:
143143
- name: Install uv for Python
144144
uses: astral-sh/setup-uv@v3
145145
with:
146-
version: "0.4.30"
146+
version: "0.5.6"
147147
enable-cache: true
148148
cache-dependency-glob: "tests/uv.lock"
149149

tests/configure-test-env.ps1

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,14 @@ If ($r) {
1414

1515
# Check python test environment ---
1616
Write-Host -ForegroundColor green ">>>> Configuring python environment"
17-
try { $null = gcm py -ea stop; $py=$true} catch {
18-
Write-Host -ForegroundColor red "Missing Python launcher - py.exe is required on Windows - it should be installed with Python for Windows."
17+
try { $null = gcm uv -ea stop; $uv=$true } catch {
18+
Write-Host -ForegroundColor red "No uv found in PATH - Install uv please: https://docs.astral.sh/uv/getting-started/installation/"
1919
}
2020

21-
try { $null = gcm python -ea stop; $python=$true } catch {
22-
Write-Host -ForegroundColor red "No python found in PATH - Check your PATH or install python add to PATH."
23-
}
24-
25-
If ( $py -and $python) {
21+
If ($uv) {
2622
Write-Host "Setting up python environnement with uv"
27-
try { $null = gcm uv -ea stop; $uv=$true } catch {
28-
Write-Host -ForegroundColor red "No uv found in PATH - Install uv please: https://docs.astral.sh/uv/getting-started/installation/"
29-
}
3023
# install from lockfile
3124
uv sync --frozen
32-
$uv=$true
3325
}
3426

3527
# Check Julia environment ---

tests/configure-test-env.sh

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,16 @@ fi
1717

1818
# Check python test environment ---
1919
echo ">>>> Configuring Python environment"
20-
python_exists=$(command -v python)
21-
if [ -z $python_exists ]
22-
then
23-
python_exists=$(command -v python3)
24-
if [ -z python_exists ]
25-
then
26-
echo "No python found in PATH - Check your PATH or install python add to PATH."
27-
fi
28-
fi
29-
if [ -n $python_exists ]
20+
# Prefer uv is available
21+
uv_exist=$(command -v uv)
22+
if [ -z $uv_exist ]
3023
then
31-
uv_exist=$(command -v uv)
32-
if [ -z $uv_exist ]
33-
echo "Setting up python environnement with uv"
34-
# create or sync the virtual env in the project
35-
uv sync --frozen
36-
then
37-
echo "No uv found - Install uv please: https://docs.astral.sh/uv/getting-started/installation/"
38-
fi
24+
echo "Setting up python environnement with uv"
25+
# create or sync the virtual env in the project
26+
uv sync --frozen
27+
else
28+
echo "No uv found - Install uv please: https://docs.astral.sh/uv/getting-started/installation/."
29+
echo "Using 'uv' is the prefered way. You can still use python and create a .venv in the project."
3930
fi
4031

4132
# Check Julia environment ---

0 commit comments

Comments
 (0)