@@ -235,18 +235,30 @@ jobs:
235235 cp $PYTHON_DIR/DLLs/tcl86t.dll $EMBED_DIR/
236236 cp $PYTHON_DIR/DLLs/tk86t.dll $EMBED_DIR/
237237
238- - name : Install pip
239- run : |
240- curl -O https://bootstrap.pypa.io/get-pip.py
241- ./python-${{ env.PYTHON_VERSION }}/python get-pip.py --no-warn-script-location
242- rm get-pip.py
243-
244238 - name : Uncomment 'import site' in python311._pth file
245239 run : |
246240 sed -i 's/#import site/import site/' python-${{ env.PYTHON_VERSION }}/python311._pth
247241
248242 - name : Install Required Packages
249- run : .\python-${{ env.PYTHON_VERSION }}\python -m pip install --force-reinstall -r requirements.txt --no-warn-script-location
243+ # Use system Python (which has development headers) to compile packages,
244+ # installing into the embeddable Python's site-packages directory.
245+ # The embeddable Python lacks Python.h headers needed for native extensions.
246+ run : python -m pip install -r requirements.txt --target python-${{ env.PYTHON_VERSION }}/Lib/site-packages --upgrade --no-warn-script-location
247+
248+ - name : Clean up unnecessary Python files
249+ shell : pwsh
250+ run : |
251+ $sitePkgs = "py/Lib/site-packages"
252+
253+ # Remove __pycache__ directories
254+ Get-ChildItem -Path $sitePkgs -Recurse -Directory -Filter "__pycache__" | Remove-Item -Recurse -Force
255+
256+ # Remove test directories
257+ Get-ChildItem -Path $sitePkgs -Recurse -Directory | Where-Object { $_.Name -match "^tests?$" } | Remove-Item -Recurse -Force
258+
259+ # Count remaining files
260+ $count = (Get-ChildItem -Path $sitePkgs -Recurse -File).Count
261+ Write-Host "Remaining files in site-packages: $count"
250262
251263 - name : Set to offline deployment
252264 run : |
@@ -357,7 +369,7 @@ jobs:
357369 <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
358370 <Product Id="*" Name="${{ env.APP_NAME }}" Language="1033" Version="1.0.0.0" Codepage="1252" Manufacturer="OpenMS Developer Team" UpgradeCode="${{ env.APP_UpgradeCode }}">
359371 <Package Id="*" InstallerVersion="300" Compressed="yes" InstallPrivileges="elevated" Platform="x64" />
360- <Media Id="1" Cabinet="streamlit.cab" EmbedCab="yes " />
372+ <MediaTemplate EmbedCab="yes" MaximumUncompressedMediaSize="200" CabinetTemplate="data{0}.cab " />
361373
362374 <!-- Folder structure -->
363375 <Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" />
0 commit comments