Revert "Revert "Release Python3.8 wheels for Windows""

pull/21340/head
Lidi Zheng 5 years ago committed by GitHub
parent 99e8d6c326
commit db4ce94ebb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 78
      tools/internal_ci/helper_scripts/install_python38.ps1
  2. 3
      tools/internal_ci/helper_scripts/prepare_build_windows.bat
  3. 7
      tools/internal_ci/windows/grpc_build_artifacts.bat
  4. 6
      tools/internal_ci/windows/grpc_build_packages.bat
  5. 6
      tools/internal_ci/windows/grpc_distribtests.bat
  6. 6
      tools/internal_ci/windows/grpc_distribtests_standalone.bat
  7. 14
      tools/run_tests/artifacts/artifact_targets.py
  8. 6
      tools/run_tests/artifacts/build_artifact_python.bat

@ -0,0 +1,78 @@
#!/usr/bin/env powershell
# Install Python 3.8 for x64 and x86 in order to build wheels on Windows.
Set-StrictMode -Version 2
# Avoid "Could not create SSL/TLS secure channel"
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
function Install-Python {
Param(
[string]$PythonVersion,
[string]$PythonInstaller,
[string]$PythonInstallPath,
[string]$PythonInstallerHash
)
$PythonInstallerUrl = "https://www.python.org/ftp/python/$PythonVersion/$PythonInstaller"
$PythonInstallerPath = "C:\tools\$PythonInstaller"
# Downloads installer
Write-Host "Downloading the Python installer: $PythonInstallerUrl => $PythonInstallerPath"
Invoke-WebRequest -Uri $PythonInstallerUrl -OutFile $PythonInstallerPath
# Validates checksum
$HashFromDownload = Get-FileHash -Path $PythonInstallerPath -Algorithm MD5
if ($HashFromDownload.Hash -ne $PythonInstallerHash) {
throw "Invalid Python installer: failed checksum!"
}
Write-Host "Python installer $PythonInstallerPath validated."
# Installs Python
& $PythonInstallerPath /passive InstallAllUsers=1 PrependPath=1 Include_test=0 TargetDir=$PythonInstallPath
if (-Not $?) {
throw "The Python installation exited with error!"
}
# Validates Python binary
# NOTE(lidiz) Even if the install command finishes in the script, that
# doesn't mean the Python installation is finished. If using "ps" to check
# for running processes, you might see ongoing installers at this point.
# So, we needs this "hack" to reliably validate that the Python binary is
# functioning properly.
$ValidationStartTime = Get-Date
$EarlyExitDDL = $ValidationStartTime.addminutes(5)
$PythonBinary = "$PythonInstallPath\python.exe"
While ($True) {
$CurrentTime = Get-Date
if ($CurrentTime -ge $EarlyExitDDL) {
throw "Invalid Python installation! Timeout!"
}
& $PythonBinary -c 'print(42)'
if ($?) {
Write-Host "Python binary works properly."
break
}
Start-Sleep -Seconds 1
}
# Installs pip
& $PythonBinary -m ensurepip --user
Write-Host "Python $PythonVersion installed by $PythonInstaller at $PythonInstallPath."
}
$Python38x86Config = @{
PythonVersion = "3.8.0"
PythonInstaller = "python-3.8.0.exe"
PythonInstallPath = "C:\Python38_32bit"
PythonInstallerHash = "412a649d36626d33b8ca5593cf18318c"
}
Install-Python @Python38x86Config
$Python38x64Config = @{
PythonVersion = "3.8.0"
PythonInstaller = "python-3.8.0-amd64.exe"
PythonInstallPath = "C:\Python38"
PythonInstallerHash = "29ea87f24c32f5e924b7d63f8a08ee8d"
}
Install-Python @Python38x64Config

@ -35,6 +35,9 @@ python -m pip install google-api-python-client
powershell -File src\csharp\install_dotnet_sdk.ps1
set PATH=%LOCALAPPDATA%\Microsoft\dotnet;%PATH%
@rem Install Python 3.8.0
powershell -File tools\internal_ci\helper_scripts\install_python38.ps1
@rem Newest version of Go is required to be able to build boringssl with cmake
@rem TODO(jtattermusch): try to eliminate the dependency on Go
choco install golang -y --version 1.13.1 --limit-output

@ -12,13 +12,6 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem Move python installation from _32bit to _32bits where they are expected by python artifact builder
@rem TODO(jtattermusch): get rid of this hack
rename C:\Python27_32bit Python27_32bits
rename C:\Python35_32bit Python35_32bits
rename C:\Python36_32bit Python36_32bits
rename C:\Python37_32bit Python37_32bits
@rem Boringssl build no longer supports yasm
choco uninstall yasm -y --limit-output
choco install nasm -y --limit-output

@ -12,12 +12,6 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem Move python installation from _32bit to _32bits where they are expected by python artifact builder
@rem TODO(jtattermusch): get rid of this hack
rename C:\Python27_32bit Python27_32bits
rename C:\Python35_32bit Python35_32bits
rename C:\Python36_32bit Python36_32bits
@rem enter repo root
cd /d %~dp0\..\..\..

@ -12,12 +12,6 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem Move python installation from _32bit to _32bits where they are expected by python artifact builder
@rem TODO(jtattermusch): get rid of this hack
rename C:\Python27_32bit Python27_32bits
rename C:\Python35_32bit Python35_32bits
rename C:\Python36_32bit Python36_32bits
@rem enter repo root
cd /d %~dp0\..\..\..

@ -12,12 +12,6 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem Move python installation from _32bit to _32bits where they are expected by python artifact builder
@rem TODO(jtattermusch): get rid of this hack
rename C:\Python27_32bit Python27_32bits
rename C:\Python35_32bit Python35_32bits
rename C:\Python36_32bit Python36_32bits
@rem enter repo root
cd /d %~dp0\..\..\..

@ -407,18 +407,16 @@ def targets():
PythonArtifact('macos', 'x64', 'python3.6'),
PythonArtifact('macos', 'x64', 'python3.7'),
PythonArtifact('macos', 'x64', 'python3.8'),
PythonArtifact('windows', 'x86', 'Python27_32bits'),
PythonArtifact('windows', 'x86', 'Python35_32bits'),
PythonArtifact('windows', 'x86', 'Python36_32bits'),
PythonArtifact('windows', 'x86', 'Python37_32bits'),
# TODO(https://github.com/grpc/grpc/issues/20615) Enable this artifact
# PythonArtifact('windows', 'x86', 'Python38_32bits'),
PythonArtifact('windows', 'x86', 'Python27_32bit'),
PythonArtifact('windows', 'x86', 'Python35_32bit'),
PythonArtifact('windows', 'x86', 'Python36_32bit'),
PythonArtifact('windows', 'x86', 'Python37_32bit'),
PythonArtifact('windows', 'x86', 'Python38_32bit'),
PythonArtifact('windows', 'x64', 'Python27'),
PythonArtifact('windows', 'x64', 'Python35'),
PythonArtifact('windows', 'x64', 'Python36'),
PythonArtifact('windows', 'x64', 'Python37'),
# TODO(https://github.com/grpc/grpc/issues/20615) Enable this artifact
# PythonArtifact('windows', 'x64', 'Python38'),
PythonArtifact('windows', 'x64', 'Python38'),
RubyArtifact('linux', 'x64'),
RubyArtifact('macos', 'x64'),
PHPArtifact('linux', 'x64')

@ -15,10 +15,10 @@
@rem set path to python & mingw compiler
set PATH=C:\%1;C:\%1\scripts;C:\msys64\mingw%2\bin;C:\tools\msys64\mingw%2\bin;%PATH%
pip install --upgrade six
python -m pip install --upgrade six
@rem some artifacts are broken for setuptools 38.5.0. See https://github.com/grpc/grpc/issues/14317
pip install --upgrade setuptools==38.2.4
pip install -rrequirements.txt
python -m pip install --upgrade setuptools==38.2.4
python -m pip install -rrequirements.txt
set GRPC_PYTHON_BUILD_WITH_CYTHON=1

Loading…
Cancel
Save