From 42db6e1fc97377cdc9538ea59da09476b9cc2a10 Mon Sep 17 00:00:00 2001 From: Adrian Vladu Date: Thu, 7 May 2026 12:35:54 +0300 Subject: [PATCH 01/19] python: use pymanager embeded Signed-off-by: Adrian Vladu --- BuildAutomation/BuildUtils.ps1 | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/BuildAutomation/BuildUtils.ps1 b/BuildAutomation/BuildUtils.ps1 index a9c3f13e..d0e87e21 100644 --- a/BuildAutomation/BuildUtils.ps1 +++ b/BuildAutomation/BuildUtils.ps1 @@ -484,7 +484,7 @@ function DownloadInstall-PythonUsingPyManager($platform, $python_template_dir, $ throw "$python_template_dir folder already exists" } - $pythonVersionEscaped = $pythonVersion.replace("_",".") + $platformSuffix + $pythonVersionEscaped = "PythonEmbed\" + $pythonVersion.replace("_",".") + $platformSuffix pymanager.exe install --target=$python_template_dir --force --update $pythonVersionEscaped if ($LASTEXITCODE) { throw "Failed to install python in directory: ${python_template_dir}" @@ -499,12 +499,12 @@ function DownloadInstall-PythonUsingPyManager($platform, $python_template_dir, $ throw "Failed to run python in directory: ${python_template_dir}" } - Remove-Item -Force -Recurse "$python_template_dir/DLLs/_tkinter.pyd" - Remove-Item -Force -Recurse "$python_template_dir/DLLs/tcl*.dll" - Remove-Item -Force -Recurse "$python_template_dir/DLLs/tk*.dll" - Remove-Item -Force -Recurse "$python_template_dir/Doc" - Remove-Item -Force -Recurse "$python_template_dir/Lib/tkinter" - Remove-Item -Force -Recurse "$python_template_dir/Lib/turtle.py" - Remove-Item -Force -Recurse "$python_template_dir/Lib/turtledemo" - Remove-Item -Force -Recurse "$python_template_dir/tcl" -} \ No newline at end of file + Remove-Item -Force -Recurse "$python_template_dir/DLLs/_tkinter.pyd" -ErrorAction SilentlyContinue + Remove-Item -Force -Recurse "$python_template_dir/DLLs/tcl*.dll" -ErrorAction SilentlyContinue + Remove-Item -Force -Recurse "$python_template_dir/DLLs/tk*.dll" -ErrorAction SilentlyContinue + Remove-Item -Force -Recurse "$python_template_dir/Doc" -ErrorAction SilentlyContinue + Remove-Item -Force -Recurse "$python_template_dir/Lib/tkinter" -ErrorAction SilentlyContinue + Remove-Item -Force -Recurse "$python_template_dir/Lib/turtle.py" -ErrorAction SilentlyContinue + Remove-Item -Force -Recurse "$python_template_dir/Lib/turtledemo" -ErrorAction SilentlyContinue + Remove-Item -Force -Recurse "$python_template_dir/tcl" -ErrorAction SilentlyContinue +} From b524a70093e8ff5cbe0cdd67128c3ac8fb00848e Mon Sep 17 00:00:00 2001 From: Adrian Vladu Date: Thu, 7 May 2026 12:45:06 +0300 Subject: [PATCH 02/19] python: ensure pip is installed --- BuildAutomation/BuildUtils.ps1 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/BuildAutomation/BuildUtils.ps1 b/BuildAutomation/BuildUtils.ps1 index d0e87e21..43c0dc8c 100644 --- a/BuildAutomation/BuildUtils.ps1 +++ b/BuildAutomation/BuildUtils.ps1 @@ -499,6 +499,15 @@ function DownloadInstall-PythonUsingPyManager($platform, $python_template_dir, $ throw "Failed to run python in directory: ${python_template_dir}" } + $pythonGetPipUrl = "https://bootstrap.pypa.io/get-pip.py" + $pythonGetPipPath = Join-Path (Resolve-Path "${python_template_dir}/..").Path "/get-pip.py" + ExecRetry { DownloadFile $pythonGetPipUrl $pythonGetPipPath } + + & "$python_template_dir/python.exe" "${pythonGetPipPath}" + if ($LASTEXITCODE) { + throw "Failed to install pip in directory: ${python_template_dir}" + } + Remove-Item -Force -Recurse "$python_template_dir/DLLs/_tkinter.pyd" -ErrorAction SilentlyContinue Remove-Item -Force -Recurse "$python_template_dir/DLLs/tcl*.dll" -ErrorAction SilentlyContinue Remove-Item -Force -Recurse "$python_template_dir/DLLs/tk*.dll" -ErrorAction SilentlyContinue From a0c2e86fd815919937ad668188161f7efc56309c Mon Sep 17 00:00:00 2001 From: Adrian Vladu Date: Thu, 7 May 2026 12:48:06 +0300 Subject: [PATCH 03/19] python: ensure pip is installed in the correct dir --- BuildAutomation/BuildCloudbaseInitSetup.ps1 | 9 +++++++++ BuildAutomation/BuildUtils.ps1 | 9 --------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/BuildAutomation/BuildCloudbaseInitSetup.ps1 b/BuildAutomation/BuildCloudbaseInitSetup.ps1 index a69d9a34..eb938bf6 100644 --- a/BuildAutomation/BuildCloudbaseInitSetup.ps1 +++ b/BuildAutomation/BuildCloudbaseInitSetup.ps1 @@ -97,6 +97,15 @@ try CheckCopyDir $python_template_dir $python_dir + $pythonGetPipUrl = "https://bootstrap.pypa.io/get-pip.py" + $pythonGetPipPath = Join-Path (Resolve-Path "${python_dir}/..").Path "/get-pip.py" + ExecRetry { DownloadFile $pythonGetPipUrl $pythonGetPipPath } + + & python.exe "${pythonGetPipPath}" + if ($LASTEXITCODE) { + throw "Failed to install pip in directory: ${python_dir}" + } + # Make sure that we don't have temp files from a previous build $python_build_path = "$ENV:LOCALAPPDATA\Temp\pip_build_$ENV:USERNAME" if (Test-Path $python_build_path) { diff --git a/BuildAutomation/BuildUtils.ps1 b/BuildAutomation/BuildUtils.ps1 index 43c0dc8c..d0e87e21 100644 --- a/BuildAutomation/BuildUtils.ps1 +++ b/BuildAutomation/BuildUtils.ps1 @@ -499,15 +499,6 @@ function DownloadInstall-PythonUsingPyManager($platform, $python_template_dir, $ throw "Failed to run python in directory: ${python_template_dir}" } - $pythonGetPipUrl = "https://bootstrap.pypa.io/get-pip.py" - $pythonGetPipPath = Join-Path (Resolve-Path "${python_template_dir}/..").Path "/get-pip.py" - ExecRetry { DownloadFile $pythonGetPipUrl $pythonGetPipPath } - - & "$python_template_dir/python.exe" "${pythonGetPipPath}" - if ($LASTEXITCODE) { - throw "Failed to install pip in directory: ${python_template_dir}" - } - Remove-Item -Force -Recurse "$python_template_dir/DLLs/_tkinter.pyd" -ErrorAction SilentlyContinue Remove-Item -Force -Recurse "$python_template_dir/DLLs/tcl*.dll" -ErrorAction SilentlyContinue Remove-Item -Force -Recurse "$python_template_dir/DLLs/tk*.dll" -ErrorAction SilentlyContinue From 308aa5e996086222268eb2a56a4fe40f473feae4 Mon Sep 17 00:00:00 2001 From: Adrian Vladu Date: Thu, 7 May 2026 12:51:45 +0300 Subject: [PATCH 04/19] python: ensure pip is installed in the correct dir --- BuildAutomation/BuildCloudbaseInitSetup.ps1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/BuildAutomation/BuildCloudbaseInitSetup.ps1 b/BuildAutomation/BuildCloudbaseInitSetup.ps1 index eb938bf6..aabbfa74 100644 --- a/BuildAutomation/BuildCloudbaseInitSetup.ps1 +++ b/BuildAutomation/BuildCloudbaseInitSetup.ps1 @@ -106,6 +106,8 @@ try throw "Failed to install pip in directory: ${python_dir}" } + python.exe -m pip install pip --upgrade + # Make sure that we don't have temp files from a previous build $python_build_path = "$ENV:LOCALAPPDATA\Temp\pip_build_$ENV:USERNAME" if (Test-Path $python_build_path) { From abedd528d8974abb2e9c3082bbeeea4303afbdd4 Mon Sep 17 00:00:00 2001 From: Adrian Vladu Date: Thu, 7 May 2026 12:53:57 +0300 Subject: [PATCH 05/19] python: ensure pip is installed in the correct dir --- BuildAutomation/BuildCloudbaseInitSetup.ps1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/BuildAutomation/BuildCloudbaseInitSetup.ps1 b/BuildAutomation/BuildCloudbaseInitSetup.ps1 index aabbfa74..ca1ef051 100644 --- a/BuildAutomation/BuildCloudbaseInitSetup.ps1 +++ b/BuildAutomation/BuildCloudbaseInitSetup.ps1 @@ -107,6 +107,8 @@ try } python.exe -m pip install pip --upgrade + python.exe -m pip install wheel --upgrade + python.exe -m pip install setuptools --upgrade # Make sure that we don't have temp files from a previous build $python_build_path = "$ENV:LOCALAPPDATA\Temp\pip_build_$ENV:USERNAME" From be8c56284c1645c91c44b667b343304cd443b915 Mon Sep 17 00:00:00 2001 From: Adrian Vladu Date: Thu, 7 May 2026 12:58:03 +0300 Subject: [PATCH 06/19] python: ensure pip is installed in the correct dir --- BuildAutomation/BuildCloudbaseInitSetup.ps1 | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/BuildAutomation/BuildCloudbaseInitSetup.ps1 b/BuildAutomation/BuildCloudbaseInitSetup.ps1 index ca1ef051..7abb0b6e 100644 --- a/BuildAutomation/BuildCloudbaseInitSetup.ps1 +++ b/BuildAutomation/BuildCloudbaseInitSetup.ps1 @@ -106,10 +106,8 @@ try throw "Failed to install pip in directory: ${python_dir}" } - python.exe -m pip install pip --upgrade - python.exe -m pip install wheel --upgrade - python.exe -m pip install setuptools --upgrade - + Out-File -Append -InputObject "Lib\site-packages" -Encoding ascii $python_dir\python*._pth + # Make sure that we don't have temp files from a previous build $python_build_path = "$ENV:LOCALAPPDATA\Temp\pip_build_$ENV:USERNAME" if (Test-Path $python_build_path) { From 360e19038da5ba529f3dc515a182aa638c6c8ca5 Mon Sep 17 00:00:00 2001 From: Adrian Vladu Date: Thu, 7 May 2026 14:57:32 +0300 Subject: [PATCH 07/19] python: ensure pbr is installed --- BuildAutomation/BuildCloudbaseInitSetup.ps1 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/BuildAutomation/BuildCloudbaseInitSetup.ps1 b/BuildAutomation/BuildCloudbaseInitSetup.ps1 index 7abb0b6e..e60d9a48 100644 --- a/BuildAutomation/BuildCloudbaseInitSetup.ps1 +++ b/BuildAutomation/BuildCloudbaseInitSetup.ps1 @@ -115,6 +115,11 @@ try } ExecRetry { PipInstall "pip" -update $true } + # When using embed Python, pbr needs to be reinstalled so that the project builds + # Warning received: UserWarning: Unknown distribution option: 'pbr' + # pbr is already installed but most likely this is a problem with knowing where it is, + # and reinstalling fixing the issue + ExecRetry { PipInstall "pbr" -update $true } ExecRetry { PipInstall "wheel" -update $true } ExecRetry { PipInstall "setuptools" -update $true } From 4765d46dba74cd95a6193188ce1fe7d590f82869 Mon Sep 17 00:00:00 2001 From: Adrian Vladu Date: Thu, 7 May 2026 15:13:02 +0300 Subject: [PATCH 08/19] python: ensure Include folder is there --- BuildAutomation/BuildUtils.ps1 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/BuildAutomation/BuildUtils.ps1 b/BuildAutomation/BuildUtils.ps1 index d0e87e21..0541f13d 100644 --- a/BuildAutomation/BuildUtils.ps1 +++ b/BuildAutomation/BuildUtils.ps1 @@ -499,6 +499,16 @@ function DownloadInstall-PythonUsingPyManager($platform, $python_template_dir, $ throw "Failed to run python in directory: ${python_template_dir}" } + $gitTag = $pythonVersion.replace("_",".") + git clone --no-checkout --depth=1 --filter=tree:0 https://github.com/python/cpython --branch "v${gitTag}" + pushd cpython + git sparse-checkout set --no-cone /Include + git checkout + popd + + Move-Item "cpython/Include" "$python_template_dir/Include" + Remove-Item -Force -Recurse "cpython" + Remove-Item -Force -Recurse "$python_template_dir/DLLs/_tkinter.pyd" -ErrorAction SilentlyContinue Remove-Item -Force -Recurse "$python_template_dir/DLLs/tcl*.dll" -ErrorAction SilentlyContinue Remove-Item -Force -Recurse "$python_template_dir/DLLs/tk*.dll" -ErrorAction SilentlyContinue From b8f44af15570be41e37350082d4534dd87fccca3 Mon Sep 17 00:00:00 2001 From: Adrian Vladu Date: Thu, 7 May 2026 15:27:09 +0300 Subject: [PATCH 09/19] python: ensure Include folder is there --- BuildAutomation/BuildCloudbaseInitSetup.ps1 | 2 -- BuildAutomation/BuildUtils.ps1 | 6 +++++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/BuildAutomation/BuildCloudbaseInitSetup.ps1 b/BuildAutomation/BuildCloudbaseInitSetup.ps1 index e60d9a48..870cb795 100644 --- a/BuildAutomation/BuildCloudbaseInitSetup.ps1 +++ b/BuildAutomation/BuildCloudbaseInitSetup.ps1 @@ -105,8 +105,6 @@ try if ($LASTEXITCODE) { throw "Failed to install pip in directory: ${python_dir}" } - - Out-File -Append -InputObject "Lib\site-packages" -Encoding ascii $python_dir\python*._pth # Make sure that we don't have temp files from a previous build $python_build_path = "$ENV:LOCALAPPDATA\Temp\pip_build_$ENV:USERNAME" diff --git a/BuildAutomation/BuildUtils.ps1 b/BuildAutomation/BuildUtils.ps1 index 0541f13d..7bad7ca0 100644 --- a/BuildAutomation/BuildUtils.ps1 +++ b/BuildAutomation/BuildUtils.ps1 @@ -499,6 +499,9 @@ function DownloadInstall-PythonUsingPyManager($platform, $python_template_dir, $ throw "Failed to run python in directory: ${python_template_dir}" } + Out-File -Append -InputObject "Lib\site-packages" -Encoding ascii $python_template_dir\python*._pth + + # fix Cannot open include file: 'pyconfig.h' $gitTag = $pythonVersion.replace("_",".") git clone --no-checkout --depth=1 --filter=tree:0 https://github.com/python/cpython --branch "v${gitTag}" pushd cpython @@ -506,7 +509,8 @@ function DownloadInstall-PythonUsingPyManager($platform, $python_template_dir, $ git checkout popd - Move-Item "cpython/Include" "$python_template_dir/Include" + Move-Item "cpython/Include" "$python_template_dir/include" + Get-ChildItem "$python_template_dir/include" Remove-Item -Force -Recurse "cpython" Remove-Item -Force -Recurse "$python_template_dir/DLLs/_tkinter.pyd" -ErrorAction SilentlyContinue From c29361b5d6b5a81b2bec23336ab266c4c8621413 Mon Sep 17 00:00:00 2001 From: Adrian Vladu Date: Thu, 7 May 2026 15:31:53 +0300 Subject: [PATCH 10/19] python: ensure Include folder is there --- BuildAutomation/BuildUtils.ps1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/BuildAutomation/BuildUtils.ps1 b/BuildAutomation/BuildUtils.ps1 index 7bad7ca0..d7203ea9 100644 --- a/BuildAutomation/BuildUtils.ps1 +++ b/BuildAutomation/BuildUtils.ps1 @@ -510,6 +510,8 @@ function DownloadInstall-PythonUsingPyManager($platform, $python_template_dir, $ popd Move-Item "cpython/Include" "$python_template_dir/include" + ExecRetry { DownloadFile "https://raw.githubusercontent.com/python/cpython/refs/tags/v${gitTag}/PC/pyconfig.h" "${python_template_dir}/include/pyconfig.h" } + Get-ChildItem "$python_template_dir/include" Remove-Item -Force -Recurse "cpython" From 6259706c9d121819c80e60c98d185887f83fad99 Mon Sep 17 00:00:00 2001 From: Adrian Vladu Date: Thu, 7 May 2026 15:35:02 +0300 Subject: [PATCH 11/19] python: ensure lib folder is used --- BuildAutomation/BuildUtils.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/BuildAutomation/BuildUtils.ps1 b/BuildAutomation/BuildUtils.ps1 index d7203ea9..f87ec5a5 100644 --- a/BuildAutomation/BuildUtils.ps1 +++ b/BuildAutomation/BuildUtils.ps1 @@ -500,6 +500,7 @@ function DownloadInstall-PythonUsingPyManager($platform, $python_template_dir, $ } Out-File -Append -InputObject "Lib\site-packages" -Encoding ascii $python_template_dir\python*._pth + Out-File -Append -InputObject "libs" -Encoding ascii $python_template_dir\python*._pth # fix Cannot open include file: 'pyconfig.h' $gitTag = $pythonVersion.replace("_",".") From bc7e76a8d732f0458713882f1705128185ffd81e Mon Sep 17 00:00:00 2001 From: Adrian Vladu Date: Thu, 7 May 2026 15:43:18 +0300 Subject: [PATCH 12/19] python: use 3.11.9 as there are no wheels for pymi for 3.14 --- .github/workflows/build_test_cbsinit.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_test_cbsinit.yml b/.github/workflows/build_test_cbsinit.yml index 88258c05..1fcdcacb 100644 --- a/.github/workflows/build_test_cbsinit.yml +++ b/.github/workflows/build_test_cbsinit.yml @@ -14,7 +14,7 @@ jobs: install_with_pymanager: ["true"] cbsinit_repo: ['https://github.com/cloudbase/cloudbase-init'] cbsinit_branch: ['master'] - python_version: ['3.14_4'] + python_version: ['3.11_9'] platform: ['x64'] cloud: [openstack] From d965ce61813761f6906912cbb7cafb79ce50b01f Mon Sep 17 00:00:00 2001 From: Adrian Vladu Date: Thu, 7 May 2026 15:47:18 +0300 Subject: [PATCH 13/19] python: over arching hack to make embeded work by borrowing include/libs folders from the full install --- .github/workflows/build_test_cbsinit.yml | 2 +- BuildAutomation/BuildUtils.ps1 | 24 +++++++++++------------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build_test_cbsinit.yml b/.github/workflows/build_test_cbsinit.yml index 1fcdcacb..88258c05 100644 --- a/.github/workflows/build_test_cbsinit.yml +++ b/.github/workflows/build_test_cbsinit.yml @@ -14,7 +14,7 @@ jobs: install_with_pymanager: ["true"] cbsinit_repo: ['https://github.com/cloudbase/cloudbase-init'] cbsinit_branch: ['master'] - python_version: ['3.11_9'] + python_version: ['3.14_4'] platform: ['x64'] cloud: [openstack] diff --git a/BuildAutomation/BuildUtils.ps1 b/BuildAutomation/BuildUtils.ps1 index f87ec5a5..bdfef3e2 100644 --- a/BuildAutomation/BuildUtils.ps1 +++ b/BuildAutomation/BuildUtils.ps1 @@ -502,19 +502,17 @@ function DownloadInstall-PythonUsingPyManager($platform, $python_template_dir, $ Out-File -Append -InputObject "Lib\site-packages" -Encoding ascii $python_template_dir\python*._pth Out-File -Append -InputObject "libs" -Encoding ascii $python_template_dir\python*._pth - # fix Cannot open include file: 'pyconfig.h' - $gitTag = $pythonVersion.replace("_",".") - git clone --no-checkout --depth=1 --filter=tree:0 https://github.com/python/cpython --branch "v${gitTag}" - pushd cpython - git sparse-checkout set --no-cone /Include - git checkout - popd - - Move-Item "cpython/Include" "$python_template_dir/include" - ExecRetry { DownloadFile "https://raw.githubusercontent.com/python/cpython/refs/tags/v${gitTag}/PC/pyconfig.h" "${python_template_dir}/include/pyconfig.h" } - - Get-ChildItem "$python_template_dir/include" - Remove-Item -Force -Recurse "cpython" + $python_template_dir_full = $python_template_dir + "_full" + $pythonVersionEscaped = $pythonVersion.replace("_",".") + $platformSuffix + pymanager.exe install --target=$python_template_dir_full --force --update $pythonVersionEscaped + if ($LASTEXITCODE) { + throw "Failed to install python in directory: ${python_template_dir_full}" + } + + Move-Item $python_template_dir_full/include python_template_dir/ + Move-Item $python_template_dir_full/libs python_template_dir/ + + Remove-Item -Force -Recurse "$python_template_dir_full" -ErrorAction SilentlyContinue Remove-Item -Force -Recurse "$python_template_dir/DLLs/_tkinter.pyd" -ErrorAction SilentlyContinue Remove-Item -Force -Recurse "$python_template_dir/DLLs/tcl*.dll" -ErrorAction SilentlyContinue From fbbc53b0ef7017a3488f83d8b95d70ee4c31e601 Mon Sep 17 00:00:00 2001 From: Adrian Vladu Date: Thu, 7 May 2026 15:50:13 +0300 Subject: [PATCH 14/19] python: over arching hack to make embeded work by borrowing include/libs folders from the full install --- BuildAutomation/BuildUtils.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BuildAutomation/BuildUtils.ps1 b/BuildAutomation/BuildUtils.ps1 index bdfef3e2..9b64674b 100644 --- a/BuildAutomation/BuildUtils.ps1 +++ b/BuildAutomation/BuildUtils.ps1 @@ -509,8 +509,8 @@ function DownloadInstall-PythonUsingPyManager($platform, $python_template_dir, $ throw "Failed to install python in directory: ${python_template_dir_full}" } - Move-Item $python_template_dir_full/include python_template_dir/ - Move-Item $python_template_dir_full/libs python_template_dir/ + Move-Item $python_template_dir_full/include $python_template_dir/ + Move-Item $python_template_dir_full/libs $python_template_dir/ Remove-Item -Force -Recurse "$python_template_dir_full" -ErrorAction SilentlyContinue From 4e838bcd5a3589cfad76850781f15bb66b70cb0d Mon Sep 17 00:00:00 2001 From: Adrian Vladu Date: Thu, 7 May 2026 16:06:50 +0300 Subject: [PATCH 15/19] python: over arching hack to make embeded work by borrowing include/libs folders from the full install --- BuildAutomation/BuildUtils.ps1 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/BuildAutomation/BuildUtils.ps1 b/BuildAutomation/BuildUtils.ps1 index 9b64674b..033910cd 100644 --- a/BuildAutomation/BuildUtils.ps1 +++ b/BuildAutomation/BuildUtils.ps1 @@ -512,6 +512,13 @@ function DownloadInstall-PythonUsingPyManager($platform, $python_template_dir, $ Move-Item $python_template_dir_full/include $python_template_dir/ Move-Item $python_template_dir_full/libs $python_template_dir/ + mkdir $python_template_dir\Lib\site-packages + + Out-File -Append -InputObject "win32" -Encoding ascii "$python_template_dir\Lib\site-packages\pywin32.pth" + Out-File -Append -InputObject "win32\lib" -Encoding ascii "$python_template_dir\Lib\site-packages\pywin32.pth" + Out-File -Append -InputObject "Pythonwin" -Encoding ascii "$python_template_dir\Lib\site-packages\pywin32.pth" + Out-File -Append -InputObject "import pywin32_bootstrap" -Encoding ascii "$python_template_dir\Lib\site-packages\pywin32.pth" + Remove-Item -Force -Recurse "$python_template_dir_full" -ErrorAction SilentlyContinue Remove-Item -Force -Recurse "$python_template_dir/DLLs/_tkinter.pyd" -ErrorAction SilentlyContinue From f2034958cdb05258a00e1d31316e0be2fee5ad24 Mon Sep 17 00:00:00 2001 From: Adrian Vladu Date: Thu, 7 May 2026 16:25:27 +0300 Subject: [PATCH 16/19] python: keep pycs --- .github/workflows/build_test_cbsinit.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_test_cbsinit.yml b/.github/workflows/build_test_cbsinit.yml index 88258c05..dd529ccd 100644 --- a/.github/workflows/build_test_cbsinit.yml +++ b/.github/workflows/build_test_cbsinit.yml @@ -10,7 +10,7 @@ jobs: matrix: os: ['windows-2022'] download_official_python_msi: ["true"] - remove_python_pycs: ["true"] + remove_python_pycs: ["false"] install_with_pymanager: ["true"] cbsinit_repo: ['https://github.com/cloudbase/cloudbase-init'] cbsinit_branch: ['master'] From 790882d491b168188dd5f8a37ae038801ca68ecb Mon Sep 17 00:00:00 2001 From: Adrian Vladu Date: Thu, 7 May 2026 16:48:30 +0300 Subject: [PATCH 17/19] python: over arching hack to make embeded work by borrowing include/libs folders from the full install --- BuildAutomation/BuildUtils.ps1 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/BuildAutomation/BuildUtils.ps1 b/BuildAutomation/BuildUtils.ps1 index 033910cd..405b3ec2 100644 --- a/BuildAutomation/BuildUtils.ps1 +++ b/BuildAutomation/BuildUtils.ps1 @@ -519,6 +519,10 @@ function DownloadInstall-PythonUsingPyManager($platform, $python_template_dir, $ Out-File -Append -InputObject "Pythonwin" -Encoding ascii "$python_template_dir\Lib\site-packages\pywin32.pth" Out-File -Append -InputObject "import pywin32_bootstrap" -Encoding ascii "$python_template_dir\Lib\site-packages\pywin32.pth" + Out-File -Append -InputObject "Lib\site-packages\win32" -Encoding ascii $python_template_dir\python*._pth + Out-File -Append -InputObject "Lib\site-packages\win32\lib" -Encoding ascii $python_template_dir\python*._pth + Out-File -Append -InputObject "Lib\site-packages\Pythonwin" -Encoding ascii $python_template_dir\python*._pth + Remove-Item -Force -Recurse "$python_template_dir_full" -ErrorAction SilentlyContinue Remove-Item -Force -Recurse "$python_template_dir/DLLs/_tkinter.pyd" -ErrorAction SilentlyContinue From 8fc35c1740b839551da09b77da49d8185b38f164 Mon Sep 17 00:00:00 2001 From: Adrian Vladu Date: Thu, 7 May 2026 16:56:03 +0300 Subject: [PATCH 18/19] python: add venv --- .github/workflows/build_test_cbsinit.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build_test_cbsinit.yml b/.github/workflows/build_test_cbsinit.yml index dd529ccd..89c63561 100644 --- a/.github/workflows/build_test_cbsinit.yml +++ b/.github/workflows/build_test_cbsinit.yml @@ -101,6 +101,7 @@ jobs: } } & $pythonPath -m pip install pip-audit + & $pythonPath -m pip install venv $pipAuditLogs = & $pipAuditPath Write-Output "$pipAuditLogs" if ($LASTEXITCODE) { From 223b101e61f82a0579abde963f7d08b6a0412e61 Mon Sep 17 00:00:00 2001 From: Adrian Vladu Date: Tue, 12 May 2026 16:47:59 +0300 Subject: [PATCH 19/19] python: remove pip-audit usage of venv --- .github/workflows/build_test_cbsinit.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build_test_cbsinit.yml b/.github/workflows/build_test_cbsinit.yml index 89c63561..e6ab6b86 100644 --- a/.github/workflows/build_test_cbsinit.yml +++ b/.github/workflows/build_test_cbsinit.yml @@ -101,8 +101,7 @@ jobs: } } & $pythonPath -m pip install pip-audit - & $pythonPath -m pip install venv - $pipAuditLogs = & $pipAuditPath + $pipAuditLogs = & $pipAuditPath --user Write-Output "$pipAuditLogs" if ($LASTEXITCODE) { throw "pip audit failed"