Skip to content

Commit cf1eedd

Browse files
authored
Merge pull request #54 from ader1990/python_3_14_4
Add Python 3.14.4
2 parents 92e273a + f252b15 commit cf1eedd

5,868 files changed

Lines changed: 602901 additions & 571755 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build_test_cbsinit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
os: ['windows-2022']
1212
cbsinit_repo: ['https://github.com/cloudbase/cloudbase-init']
1313
cbsinit_branch: ['master']
14-
python_version: ['3.13_13']
14+
python_version: ['3.14_4']
1515
platform: ['x64']
1616
cloud: [openstack]
1717

BuildAutomation/BuildCloudbaseInitSetup.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Param(
22
[string]$platform = "x64",
3-
[string]$pythonversion = "3.13_13",
3+
[string]$pythonversion = "3.14_4",
44
[string]$SignX509Thumbprint = $null,
55
[string]$release = $null,
66
# Cloudbase-Init repo details

BuildAutomation/BuildUtils.ps1

Lines changed: 65 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -393,8 +393,70 @@ function ImportCertificateUser($pfxPath, $pfxPassword) {
393393
}
394394

395395
function ChechFileHash($path, $hash, $algorithm="SHA1") {
396-
$h = Get-Filehash -Algorithm $algorithm $path
397-
if ($h.Hash.ToUpper() -ne $hash.ToUpper()) {
398-
throw "Hash comparison failed for file: $path"
396+
$actualHash = (Get-Filehash -Algorithm $algorithm $path).Hash.ToUpper()
397+
if ($actualHash -ne $hash.ToUpper()) {
398+
throw "Hash comparison failed for file: $path. Expected hash: ${hash}. Actual hash: ${actualHash}"
399399
}
400400
}
401+
402+
403+
function DownloadInstall-PythonMsi($platform, $python_template_dir, $pythonVersion, $PythonMsiChecksum, $algorithm="SHA1") {
404+
$platformSuffix = ""
405+
if ($platform -eq "x64") {
406+
$platformSuffix = "-amd64"
407+
}
408+
409+
if (Test-Path $python_template_dir) {
410+
throw "$python_template_dir folder already exists"
411+
}
412+
413+
$pythonInstallerPath = Join-Path (Resolve-Path "${python_template_dir}/..").Path "/python-${pythonVersion}${platformSuffix}.exe"
414+
$pythonVersionEscaped = $pythonVersion.replace("_",".")
415+
$PythonMsiUrl = "https://www.python.org/ftp/python/${pythonVersionEscaped}/python-${pythonVersionEscaped}${platformSuffix}.exe"
416+
417+
if ($python_template_dir -and (Test-Path $python_template_dir)) {
418+
throw "Python template directory already exists"
419+
}
420+
421+
$tmp_python_template_dir = "${python_template_dir}_tmp"
422+
if ($tmp_python_template_dir -and (Test-Path $tmp_python_template_dir)) {
423+
throw "Python temp template directory already exists"
424+
}
425+
426+
try {
427+
ExecRetry { DownloadFile $PythonMsiUrl $pythonInstallerPath }
428+
ChechFileHash $pythonInstallerPath $PythonMsiChecksum $algorithm
429+
430+
Write-Host "Trying to uninstall Python using $pythonInstallerPath"
431+
Start-Process -FilePath "${pythonInstallerPath}" -NoNewWindow -Wait `
432+
-ArgumentList @("/quiet", "/uninstall")
433+
434+
$package = Get-Package -Name "Python ${pythonVersionEscaped}*" -ErrorAction SilentlyContinue
435+
if ($package) {
436+
throw "Python package was already installed"
437+
}
438+
439+
Write-Host "Installing Python using $pythonInstallerPath"
440+
Start-Process -FilePath "${pythonInstallerPath}" -NoNewWindow -Wait `
441+
-ArgumentList @("/quiet", "TargetDir=${tmp_python_template_dir}","Include_test=0","Include_tcltk=0","Include_launcher=0","Include_doc=0")
442+
443+
Copy-Item -Recurse $tmp_python_template_dir $python_template_dir
444+
445+
} finally {
446+
447+
Start-Process -FilePath "${pythonInstallerPath}" -NoNewWindow -Wait `
448+
-ArgumentList @("/quiet", "/uninstall")
449+
450+
if (Test-Path $pythonInstallerPath) {
451+
Remove-Item $pythonInstallerPath
452+
}
453+
454+
if (Test-Path $tmp_python_template_dir) {
455+
Remove-Item $tmp_python_template_dir -Recurse -Force
456+
}
457+
}
458+
if (!(Test-Path $python_template_dir)) {
459+
throw "$python_template_dir has not been created"
460+
}
461+
462+
}
-71.3 KB
Binary file not shown.
-84.8 KB
Binary file not shown.
-131 KB
Binary file not shown.
-280 KB
Binary file not shown.
-133 KB
Binary file not shown.
-67.8 KB
Binary file not shown.
-156 KB
Binary file not shown.

0 commit comments

Comments
 (0)