From f502c1ab80073d66686b20682068661014d6ecd2 Mon Sep 17 00:00:00 2001 From: Alejandro Martinez Date: Tue, 10 Feb 2026 14:18:31 -0300 Subject: [PATCH] AppVeyor - move embedded Python to after_build.sh Like for the Linux case it is not necessary for building, only to create the Windows installer --- appveyor/windows/after_build.ps1 | 21 +++++++++++++++++++++ appveyor/windows/install.ps1 | 21 --------------------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/appveyor/windows/after_build.ps1 b/appveyor/windows/after_build.ps1 index 33d1d8cf7..48f1b9cac 100644 --- a/appveyor/windows/after_build.ps1 +++ b/appveyor/windows/after_build.ps1 @@ -1,3 +1,24 @@ +# Python version configuration - update this when upgrading Python +$PYTHON_EMBED_VERSION="3.11.9" + +# Get Python +if (-not (Test-Path 'C:\Python')) { + $pyurl = "https://www.python.org/ftp/python/$PYTHON_EMBED_VERSION/python-$PYTHON_EMBED_VERSION-embed-amd64.zip" + Start-FileDownload $pyurl "python-embed.zip" + Expand-Archive -Path python-embed.zip -DestinationPath C:\Python -Force + # Enable site import + mkdir C:\Python\lib\site-packages + $py_ver = $($env:PYTHON_VERSION -replace '\.', '') + (Get-Content C:\Python\python$py_ver._pth) -replace '#import site', 'import site' | Set-Content C:\Python\python$py_ver._pth + # Enable pip in embedded Python + Start-FileDownload "https://bootstrap.pypa.io/get-pip.py" "get-pip.py" + C:\Python\python.exe get-pip.py --no-warn-script-location + # Upgrade pip to ensure you have the latest version + C:\Python\python -m pip install --upgrade pip + # Install your project's dependencies from a requirements.txt file + C:\Python\python -m pip install --upgrade --only-binary :all: -r src\Python\requirements.txt -t C:\Python\lib\site-packages +} + Set-Location src\release # Copy dependencies diff --git a/appveyor/windows/install.ps1 b/appveyor/windows/install.ps1 index c28d9ef1d..82a15254d 100644 --- a/appveyor/windows/install.ps1 +++ b/appveyor/windows/install.ps1 @@ -1,6 +1,3 @@ -# Python version configuration - update this when upgrading Python -$PYTHON_EMBED_VERSION="3.11.9" - # Get the libraries if (-not (Test-Path 'C:\LIBS')) { Start-FileDownload "https://github.com/GoldenCheetah/WindowsSDK/releases/download/v0.1.1/gc-ci-libs.zip" @@ -25,21 +22,3 @@ if (-not (Test-Path 'C:\R')) { Start-Process -FilePath .\R-win.exe -ArgumentList "/VERYSILENT /DIR=C:\R" -NoNewWindow -Wait } C:\R\bin\R --version - -# Get Python -if (-not (Test-Path 'C:\Python')) { - $pyurl = "https://www.python.org/ftp/python/$PYTHON_EMBED_VERSION/python-$PYTHON_EMBED_VERSION-embed-amd64.zip" - Start-FileDownload $pyurl "python-embed.zip" - Expand-Archive -Path python-embed.zip -DestinationPath C:\Python -Force - # Enable site import - mkdir C:\Python\lib\site-packages - $py_ver = $($env:PYTHON_VERSION -replace '\.', '') - (Get-Content C:\Python\python$py_ver._pth) -replace '#import site', 'import site' | Set-Content C:\Python\python$py_ver._pth - # Enable pip in embedded Python - Start-FileDownload "https://bootstrap.pypa.io/get-pip.py" "get-pip.py" - C:\Python\python.exe get-pip.py --no-warn-script-location - # Upgrade pip to ensure you have the latest version - C:\Python\python -m pip install --upgrade pip - # Install your project's dependencies from a requirements.txt file - C:\Python\python -m pip install --upgrade --only-binary :all: -r src\Python\requirements.txt -t C:\Python\lib\site-packages -}