From 495afead21d55183272720a9745470204f28afbb Mon Sep 17 00:00:00 2001 From: Bu Sun Kim Date: Wed, 29 Sep 2021 18:55:27 +0000 Subject: [PATCH 1/4] Add python 3.10 --- .../dockerfile/test/python310/Dockerfile | 31 +++++++++++++++++++ kokoro/linux/python310/build.sh | 18 +++++++++++ kokoro/linux/python310/continuous.cfg | 11 +++++++ kokoro/linux/python310/presubmit.cfg | 11 +++++++ kokoro/linux/python310_cpp/build.sh | 18 +++++++++++ kokoro/linux/python310_cpp/continuous.cfg | 11 +++++++ kokoro/linux/python310_cpp/presubmit.cfg | 11 +++++++ .../release/python/linux/build_artifacts.sh | 2 ++ .../release/python/macos/build_artifacts.sh | 1 + .../python/windows/build_artifacts.bat | 10 ++++++ .../python/windows/build_single_artifact.bat | 6 ++++ .../windows/install_python_interpreters.ps1 | 17 ++++++++++ tests.sh | 9 ++++++ 13 files changed, 156 insertions(+) create mode 100644 kokoro/linux/dockerfile/test/python310/Dockerfile create mode 100755 kokoro/linux/python310/build.sh create mode 100644 kokoro/linux/python310/continuous.cfg create mode 100644 kokoro/linux/python310/presubmit.cfg create mode 100755 kokoro/linux/python310_cpp/build.sh create mode 100644 kokoro/linux/python310_cpp/continuous.cfg create mode 100644 kokoro/linux/python310_cpp/presubmit.cfg diff --git a/kokoro/linux/dockerfile/test/python310/Dockerfile b/kokoro/linux/dockerfile/test/python310/Dockerfile new file mode 100644 index 0000000000000..e16e93b3b2465 --- /dev/null +++ b/kokoro/linux/dockerfile/test/python310/Dockerfile @@ -0,0 +1,31 @@ +FROM python:3.10-buster + +# Install dependencies. We start with the basic ones require to build protoc +# and the C++ build +RUN apt-get update && apt-get install -y \ + autoconf \ + autotools-dev \ + build-essential \ + bzip2 \ + ccache \ + curl \ + gcc \ + git \ + libc6 \ + libc6-dbg \ + libc6-dev \ + libgtest-dev \ + libtool \ + make \ + parallel \ + time \ + wget \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +# Install Python libraries. +RUN python -m pip install --no-cache-dir --upgrade \ + pip \ + setuptools \ + tox \ + wheel diff --git a/kokoro/linux/python310/build.sh b/kokoro/linux/python310/build.sh new file mode 100755 index 0000000000000..0d8a2c9c6d497 --- /dev/null +++ b/kokoro/linux/python310/build.sh @@ -0,0 +1,18 @@ +#!/bin/bash +# +# This is the top-level script we give to Kokoro as the entry point for +# running the "pull request" project: +# +# This script selects a specific Dockerfile (for building a Docker image) and +# a script to run inside that image. Then we delegate to the general +# build_and_run_docker.sh script. + +# Change to repo root +cd $(dirname $0)/../../.. + +export DOCKERHUB_ORGANIZATION=protobuftesting +export DOCKERFILE_DIR=kokoro/linux/dockerfile/test/python310 +export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh +export OUTPUT_DIR=testoutput +export TEST_SET="python310" +./kokoro/linux/build_and_run_docker.sh diff --git a/kokoro/linux/python310/continuous.cfg b/kokoro/linux/python310/continuous.cfg new file mode 100644 index 0000000000000..6ec74d8597e81 --- /dev/null +++ b/kokoro/linux/python310/continuous.cfg @@ -0,0 +1,11 @@ +# Config file for running tests in Kokoro + +# Location of the build script in repository +build_file: "protobuf/kokoro/linux/python310/build.sh" +timeout_mins: 120 + +action { + define_artifacts { + regex: "**/sponge_log.xml" + } +} diff --git a/kokoro/linux/python310/presubmit.cfg b/kokoro/linux/python310/presubmit.cfg new file mode 100644 index 0000000000000..6ec74d8597e81 --- /dev/null +++ b/kokoro/linux/python310/presubmit.cfg @@ -0,0 +1,11 @@ +# Config file for running tests in Kokoro + +# Location of the build script in repository +build_file: "protobuf/kokoro/linux/python310/build.sh" +timeout_mins: 120 + +action { + define_artifacts { + regex: "**/sponge_log.xml" + } +} diff --git a/kokoro/linux/python310_cpp/build.sh b/kokoro/linux/python310_cpp/build.sh new file mode 100755 index 0000000000000..2903a2d9c2dd4 --- /dev/null +++ b/kokoro/linux/python310_cpp/build.sh @@ -0,0 +1,18 @@ +#!/bin/bash +# +# This is the top-level script we give to Kokoro as the entry point for +# running the "pull request" project: +# +# This script selects a specific Dockerfile (for building a Docker image) and +# a script to run inside that image. Then we delegate to the general +# build_and_run_docker.sh script. + +# Change to repo root +cd $(dirname $0)/../../.. + +export DOCKERHUB_ORGANIZATION=protobuftesting +export DOCKERFILE_DIR=kokoro/linux/dockerfile/test/python310 +export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh +export OUTPUT_DIR=testoutput +export TEST_SET="python310_cpp" +./kokoro/linux/build_and_run_docker.sh diff --git a/kokoro/linux/python310_cpp/continuous.cfg b/kokoro/linux/python310_cpp/continuous.cfg new file mode 100644 index 0000000000000..7ec844196e240 --- /dev/null +++ b/kokoro/linux/python310_cpp/continuous.cfg @@ -0,0 +1,11 @@ +# Config file for running tests in Kokoro + +# Location of the build script in repository +build_file: "protobuf/kokoro/linux/python310_cpp/build.sh" +timeout_mins: 120 + +action { + define_artifacts { + regex: "**/sponge_log.xml" + } +} diff --git a/kokoro/linux/python310_cpp/presubmit.cfg b/kokoro/linux/python310_cpp/presubmit.cfg new file mode 100644 index 0000000000000..7ec844196e240 --- /dev/null +++ b/kokoro/linux/python310_cpp/presubmit.cfg @@ -0,0 +1,11 @@ +# Config file for running tests in Kokoro + +# Location of the build script in repository +build_file: "protobuf/kokoro/linux/python310_cpp/build.sh" +timeout_mins: 120 + +action { + define_artifacts { + regex: "**/sponge_log.xml" + } +} diff --git a/kokoro/release/python/linux/build_artifacts.sh b/kokoro/release/python/linux/build_artifacts.sh index 2407a302c7879..31da562814410 100755 --- a/kokoro/release/python/linux/build_artifacts.sh +++ b/kokoro/release/python/linux/build_artifacts.sh @@ -61,7 +61,9 @@ build_artifact_version 3.6 build_artifact_version 3.7 build_artifact_version 3.8 build_artifact_version 3.9 +build_artifact_version 3.10 build_crosscompiled_aarch64_artifact_version 3.7 build_crosscompiled_aarch64_artifact_version 3.8 build_crosscompiled_aarch64_artifact_version 3.9 +build_crosscompiled_aarch64_artifact_version 3.10 diff --git a/kokoro/release/python/macos/build_artifacts.sh b/kokoro/release/python/macos/build_artifacts.sh index fbbd650b71c7f..75644539fa057 100755 --- a/kokoro/release/python/macos/build_artifacts.sh +++ b/kokoro/release/python/macos/build_artifacts.sh @@ -55,3 +55,4 @@ build_artifact_version 3.6 build_artifact_version 3.7 build_artifact_version 3.8 build_artifact_version 3.9 +build_artifact_version 3.10 diff --git a/kokoro/release/python/windows/build_artifacts.bat b/kokoro/release/python/windows/build_artifacts.bat index 5c5df7c21cbd2..b329a360394bb 100644 --- a/kokoro/release/python/windows/build_artifacts.bat +++ b/kokoro/release/python/windows/build_artifacts.bat @@ -74,6 +74,16 @@ SET PYTHON_VERSION=3.9 SET PYTHON_ARCH=64 CALL build_single_artifact.bat || goto :error +SET PYTHON=C:\python310_32bit +SET PYTHON_VERSION=3.10 +SET PYTHON_ARCH=32 +CALL build_single_artifact.bat || goto :error + +SET PYTHON=C:\python310 +SET PYTHON_VERSION=3.10 +SET PYTHON_ARCH=64 +CALL build_single_artifact.bat || goto :error + goto :EOF :error diff --git a/kokoro/release/python/windows/build_single_artifact.bat b/kokoro/release/python/windows/build_single_artifact.bat index 920f9c83a8bf1..8d3cd0c9d8ee9 100644 --- a/kokoro/release/python/windows/build_single_artifact.bat +++ b/kokoro/release/python/windows/build_single_artifact.bat @@ -24,6 +24,12 @@ if %PYTHON%==C:\python39_32bit set vcplatform=Win32 if %PYTHON%==C:\python39 set generator=Visual Studio 14 Win64 if %PYTHON%==C:\python39 set vcplatform=x64 +if %PYTHON%==C:\python310_32bit set generator=Visual Studio 14 +if %PYTHON%==C:\python310_32bit set vcplatform=Win32 + +if %PYTHON%==C:\python310 set generator=Visual Studio 14 Win64 +if %PYTHON%==C:\python310 set vcplatform=x64 + REM Prepend newly installed Python to the PATH of this build (this cannot be REM done from inside the powershell script as it would require to restart REM the parent CMD process). diff --git a/kokoro/release/python/windows/install_python_interpreters.ps1 b/kokoro/release/python/windows/install_python_interpreters.ps1 index b63259a829848..7aed535bb113e 100644 --- a/kokoro/release/python/windows/install_python_interpreters.ps1 +++ b/kokoro/release/python/windows/install_python_interpreters.ps1 @@ -95,3 +95,20 @@ $Python39x64Config = @{ PythonInstallerHash = "b61a33dc28f13b561452f3089c87eb63" } Install-Python @Python39x64Config + +# Python 3.10 +$Python39x86Config = @{ + PythonVersion = "3.10.0" + PythonInstaller = "python-3.10.0" + PythonInstallPath = "C:\python310_32bit" + PythonInstallerHash = "6de353f2f7422aa030d4ccc788ffa75e" +} +Install-Python @Python310x86Config + +$Python39x64Config = @{ + PythonVersion = "3.10.0" + PythonInstaller = "python-3.10.0-amd64" + PythonInstallPath = "C:\python39" + PythonInstallerHash = "39135519b044757f0a3b09d63612b0da" +} +Install-Python @Python310x64Config diff --git a/tests.sh b/tests.sh index 5dc2eb6ff809e..52f55a7b811d1 100755 --- a/tests.sh +++ b/tests.sh @@ -356,6 +356,10 @@ build_python39() { build_python_version py39-python } +build_python310() { + build_python_version py310-python +} + build_python_cpp() { internal_build_cpp export LD_LIBRARY_PATH=../src/.libs # for Linux @@ -408,6 +412,11 @@ build_python39_cpp() { build_python_cpp_version py39-cpp } +build_python310_cpp() { + build_python_cpp_version py39-cpp +} + + build_ruby23() { internal_build_cpp # For conformance tests. cd ruby && bash travis-test.sh ruby-2.3.8 && cd .. From aed08773b7c73def49da32c647c42298a54672a5 Mon Sep 17 00:00:00 2001 From: Bu Sun Kim Date: Wed, 29 Sep 2021 18:59:29 +0000 Subject: [PATCH 2/4] Update setup.py and tox.ini --- python/setup.py | 3 +++ python/tox.ini | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/python/setup.py b/python/setup.py index 63118c23cb855..7d931d9c1d274 100755 --- a/python/setup.py +++ b/python/setup.py @@ -292,6 +292,9 @@ def get_option_from_sys_argv(option_str): "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", ], namespace_packages=['google'], packages=find_packages( diff --git a/python/tox.ini b/python/tox.ini index 88dd842e82198..7142b86f0fdf0 100644 --- a/python/tox.ini +++ b/python/tox.ini @@ -1,6 +1,6 @@ [tox] envlist = - py{35,36,37,38,39}-{cpp,python} + py{35,36,37,38,39,310}-{cpp,python} [testenv] usedevelop=true @@ -14,7 +14,7 @@ setenv = commands = python setup.py -q build_py python: python setup.py -q build - py{35,36,37,38,39}-cpp: python setup.py -q build --cpp_implementation --warnings_as_errors --compile_static_extension + py{35,36,37,38,39,310}-cpp: python setup.py -q build --cpp_implementation --warnings_as_errors --compile_static_extension python: python setup.py -q test -q cpp: python setup.py -q test -q --cpp_implementation python: python setup.py -q test_conformance From 285ca3c5c72396f31ab774fa600ff3657cf783f2 Mon Sep 17 00:00:00 2001 From: Bu Sun Kim Date: Wed, 29 Sep 2021 19:39:30 +0000 Subject: [PATCH 3/4] fix: fix 3.9 -> 3.10 --- kokoro/release/python/windows/install_python_interpreters.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kokoro/release/python/windows/install_python_interpreters.ps1 b/kokoro/release/python/windows/install_python_interpreters.ps1 index 7aed535bb113e..f193eedeb0e9c 100644 --- a/kokoro/release/python/windows/install_python_interpreters.ps1 +++ b/kokoro/release/python/windows/install_python_interpreters.ps1 @@ -108,7 +108,7 @@ Install-Python @Python310x86Config $Python39x64Config = @{ PythonVersion = "3.10.0" PythonInstaller = "python-3.10.0-amd64" - PythonInstallPath = "C:\python39" + PythonInstallPath = "C:\python310" PythonInstallerHash = "39135519b044757f0a3b09d63612b0da" } Install-Python @Python310x64Config From 1c7b649673612803412e74f4c362e7c7f42c869d Mon Sep 17 00:00:00 2001 From: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com> Date: Fri, 15 Oct 2021 11:21:24 -0600 Subject: [PATCH 4/4] fix: py310-cpp --- tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests.sh b/tests.sh index fd2337b387ff8..176bc5f2bc6ec 100755 --- a/tests.sh +++ b/tests.sh @@ -432,7 +432,7 @@ build_python39_cpp() { } build_python310_cpp() { - build_python_cpp_version py39-cpp + build_python_cpp_version py310-cpp }