Skip to content

Commit 50dc6b8

Browse files
[windows] replace wheels with automatic pip install
1 parent 6ff163b commit 50dc6b8

File tree

1 file changed

+7
-37
lines changed

1 file changed

+7
-37
lines changed

utils/build.ps1

Lines changed: 7 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -338,29 +338,6 @@ $KnownPythons = @{
338338
}
339339
}
340340

341-
$PythonWheels = @{
342-
"packaging" = @{
343-
File = "packaging-24.1-py3-none-any.whl";
344-
URL = "https://files.pythonhosted.org/packages/08/aa/cc0199a5f0ad350994d660967a8efb233fe0416e4639146c089643407ce6/packaging-24.1-py3-none-any.whl";
345-
SHA256 = "5b8f2217dbdbd2f7f384c41c628544e6d52f2d0f53c6d0c3ea61aa5d1d7ff124";
346-
};
347-
"distutils" = @{
348-
File = "setuptools-75.1.0-py3-none-any.whl";
349-
URL = "https://files.pythonhosted.org/packages/ff/ae/f19306b5a221f6a436d8f2238d5b80925004093fa3edea59835b514d9057/setuptools-75.1.0-py3-none-any.whl";
350-
SHA256 = "35ab7fd3bcd95e6b7fd704e4a1539513edad446c097797f2985e0e4b960772f2";
351-
};
352-
"psutil" = @{
353-
File = "psutil-6.1.0-cp37-abi3-win_amd64.whl";
354-
URL = "https://files.pythonhosted.org/packages/11/91/87fa6f060e649b1e1a7b19a4f5869709fbf750b7c8c262ee776ec32f3028/psutil-6.1.0-cp37-abi3-win_amd64.whl";
355-
SHA256 = "a8fb3752b491d246034fa4d279ff076501588ce8cbcdbb62c32fd7a377d996be";
356-
};
357-
"unittest2" = @{
358-
File = "unittest2-1.1.0-py2.py3-none-any.whl";
359-
URL = "https://files.pythonhosted.org/packages/72/20/7f0f433060a962200b7272b8c12ba90ef5b903e218174301d0abfd523813/unittest2-1.1.0-py2.py3-none-any.whl";
360-
SHA256 = "13f77d0875db6d9b435e1d4f41e74ad4cc2eb6e1d5c824996092b3430f088bb8";
361-
};
362-
}
363-
364341
$KnownNDKs = @{
365342
r26b = @{
366343
URL = "https://dl.google.com/android/repository/android-ndk-r26b-windows.zip"
@@ -1007,32 +984,25 @@ function Get-Dependencies {
1007984
}
1008985
}
1009986

1010-
function Install-PythonWheel([string] $ModuleName) {
987+
function Install-PythonModule([string] $ModuleName, [string] $ModuleVersion) {
1011988
try {
1012989
Invoke-Program -Silent "$(Get-PythonExecutable)" -c "import $ModuleName"
1013990
} catch {
1014-
$Wheel = $PythonWheels[$ModuleName]
1015-
DownloadAndVerify $Wheel.URL "$BinaryCache\python\$($Wheel.File)" $Wheel.SHA256
1016-
Write-Output "Installing '$($Wheel.File)' ..."
1017-
Invoke-Program -OutNull "$(Get-PythonExecutable)" '-I' -m pip install "$BinaryCache\python\$($Wheel.File)" --disable-pip-version-check
991+
Write-Output "Installing '$($ModuleName)' ..."
992+
Invoke-Program -OutNull "$(Get-PythonExecutable)" '-I' -m pip install "$ModuleName==$ModuleVersion" --disable-pip-version-check
1018993
} finally {
1019994
Write-Output "$ModuleName installed."
1020995
}
1021996
}
1022997

1023998
function Install-PythonModules() {
1024999
Install-PIPIfNeeded
1025-
Install-PythonWheel "packaging" # For building LLVM 18+
1026-
Install-PythonWheel "distutils" # Required for SWIG support
1000+
Install-PythonModule "packaging" "24.1" # For building LLVM 18+
1001+
Install-PythonModule "distutils" "75.1.0" # Required for SWIG support
10271002
if ($Test -contains "lldb") {
1028-
if ($env:PROCESSOR_ARCHITECTURE -eq "ARM64") {
1029-
Write-Output "Installing 'psutil' ..."
1030-
Invoke-Program -OutNull "$(Get-PythonExecutable)" '-I' -m pip install "psutil==6.1.0" --disable-pip-version-check
1031-
} else {
1032-
Install-PythonWheel "psutil" # Required for testing LLDB
1033-
}
1003+
Install-PythonModule "psutil" "6.1.0" # Required for testing LLDB
10341004
$env:Path = "$(Get-PythonScriptsPath);$env:Path" # For unit.exe
1035-
Install-PythonWheel "unittest2" # Required for testing LLDB
1005+
Install-PythonModule "unittest2" "1.1.0" # Required for testing LLDB
10361006
}
10371007
}
10381008

0 commit comments

Comments
 (0)