Skip to content

Commit

Permalink
hotfix(windows) compute Python installation dir from its version
Browse files Browse the repository at this point in the history
Signed-off-by: Damien Duportal <[email protected]>
  • Loading branch information
dduportal committed Jan 2, 2025
1 parent ac461d2 commit 0f9f9b2
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions provisioning/windows-provision.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ New-Item -ItemType Directory -Path $baseDir -Force | Out-Null
$dockerPluginsDir = 'C:\ProgramData\docker\cli-plugins'
New-Item -ItemType Directory -Path $dockerPluginsDir -Force | Out-Null

# Compute the future python installation dir
$pythondir = 'C:\python{0}' -f "${env:PYTHON3_VERSION}".Replace(".", "").Substring(0, 3)

# Ensure NuGet package provider is initialized (non-interactively)
Get-PackageProvider NuGet -ForceBootstrap

Expand Down Expand Up @@ -258,7 +261,7 @@ $downloads = [ordered]@{
& Remove-Item -Force -Recurse "$baseDir\chocolatey.tmp";
};
'cleanupLocal' = 'true';
'path' = "C:\HashiCorp\Vagrant\;C:\Program Files\Amazon\AWSCLIV2\;c:\python312\;C:\python312\Scripts\;";
'path' = "C:\HashiCorp\Vagrant\;C:\Program Files\Amazon\AWSCLIV2\;${pythondir}\;${pythondir}\Scripts\;";
'postInstall' = {
# Installation of make for Windows
& "choco.exe" install make --yes --no-progress --limit-output --fail-on-error-output;
Expand All @@ -280,8 +283,8 @@ $downloads = [ordered]@{
# Installation of python3 for Launchable
& "choco.exe" install python3 --yes --no-progress --limit-output --fail-on-error-output --version "${env:PYTHON3_VERSION}";
# Installation of Launchable globally (no other python tool)
& "c:\python312\python.exe" -m pip --no-cache-dir --upgrade install setuptools wheel pip;
& "c:\python312\python.exe" -m pip --no-cache-dir install launchable=="${env:LAUNCHABLE_VERSION}";
& "${pythondir}\python.exe" -m pip --no-cache-dir --upgrade install setuptools wheel pip;
& "${pythondir}\python.exe" -m pip --no-cache-dir install launchable=="${env:LAUNCHABLE_VERSION}";
};
};
}
Expand Down

0 comments on commit 0f9f9b2

Please sign in to comment.