From 51c80ce1d574b3b82f1163cae502b853b7ac2be3 Mon Sep 17 00:00:00 2001 From: Bu Sun Kim Date: Fri, 4 Dec 2020 21:16:47 +0000 Subject: [PATCH] add python 3.9 --- .../linux/dockerfile/test/python39/Dockerfile | 31 +++++++++++++++++++ kokoro/linux/python39/build.sh | 18 +++++++++++ kokoro/linux/python39/continuous.cfg | 11 +++++++ kokoro/linux/python39/presubmit.cfg | 11 +++++++ kokoro/linux/python39_cpp/build.sh | 18 +++++++++++ kokoro/linux/python39_cpp/continuous.cfg | 11 +++++++ kokoro/linux/python39_cpp/presubmit.cfg | 11 +++++++ .../release/python/linux/build_artifacts.sh | 1 + .../release/python/macos/build_artifacts.sh | 1 + .../python/windows/build_artifacts.bat | 10 ++++++ .../python/windows/build_single_artifact.bat | 6 ++++ python/setup.py | 2 ++ python/tox.ini | 2 +- tests.sh | 8 +++++ 14 files changed, 140 insertions(+), 1 deletion(-) create mode 100644 kokoro/linux/dockerfile/test/python39/Dockerfile create mode 100755 kokoro/linux/python39/build.sh create mode 100644 kokoro/linux/python39/continuous.cfg create mode 100644 kokoro/linux/python39/presubmit.cfg create mode 100755 kokoro/linux/python39_cpp/build.sh create mode 100644 kokoro/linux/python39_cpp/continuous.cfg create mode 100644 kokoro/linux/python39_cpp/presubmit.cfg diff --git a/kokoro/linux/dockerfile/test/python39/Dockerfile b/kokoro/linux/dockerfile/test/python39/Dockerfile new file mode 100644 index 0000000000..ee7554dd64 --- /dev/null +++ b/kokoro/linux/dockerfile/test/python39/Dockerfile @@ -0,0 +1,31 @@ +FROM python:3.9-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/python39/build.sh b/kokoro/linux/python39/build.sh new file mode 100755 index 0000000000..497dc66e7c --- /dev/null +++ b/kokoro/linux/python39/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/python39 +export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh +export OUTPUT_DIR=testoutput +export TEST_SET="python39" +./kokoro/linux/build_and_run_docker.sh diff --git a/kokoro/linux/python39/continuous.cfg b/kokoro/linux/python39/continuous.cfg new file mode 100644 index 0000000000..b03bc908df --- /dev/null +++ b/kokoro/linux/python39/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/python39/build.sh" +timeout_mins: 120 + +action { + define_artifacts { + regex: "**/sponge_log.xml" + } +} diff --git a/kokoro/linux/python39/presubmit.cfg b/kokoro/linux/python39/presubmit.cfg new file mode 100644 index 0000000000..b03bc908df --- /dev/null +++ b/kokoro/linux/python39/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/python39/build.sh" +timeout_mins: 120 + +action { + define_artifacts { + regex: "**/sponge_log.xml" + } +} diff --git a/kokoro/linux/python39_cpp/build.sh b/kokoro/linux/python39_cpp/build.sh new file mode 100755 index 0000000000..f45d2ec7c3 --- /dev/null +++ b/kokoro/linux/python39_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/python39 +export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh +export OUTPUT_DIR=testoutput +export TEST_SET="python39_cpp" +./kokoro/linux/build_and_run_docker.sh diff --git a/kokoro/linux/python39_cpp/continuous.cfg b/kokoro/linux/python39_cpp/continuous.cfg new file mode 100644 index 0000000000..dd84fbe86b --- /dev/null +++ b/kokoro/linux/python39_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/python39_cpp/build.sh" +timeout_mins: 120 + +action { + define_artifacts { + regex: "**/sponge_log.xml" + } +} diff --git a/kokoro/linux/python39_cpp/presubmit.cfg b/kokoro/linux/python39_cpp/presubmit.cfg new file mode 100644 index 0000000000..dd84fbe86b --- /dev/null +++ b/kokoro/linux/python39_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/python39_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 fd9d5a9395..6b1836f407 100755 --- a/kokoro/release/python/linux/build_artifacts.sh +++ b/kokoro/release/python/linux/build_artifacts.sh @@ -54,3 +54,4 @@ build_artifact_version 3.5 build_artifact_version 3.6 build_artifact_version 3.7 build_artifact_version 3.8 +build_artifact_version 3.9 diff --git a/kokoro/release/python/macos/build_artifacts.sh b/kokoro/release/python/macos/build_artifacts.sh index 15aae39777..7801b0125f 100755 --- a/kokoro/release/python/macos/build_artifacts.sh +++ b/kokoro/release/python/macos/build_artifacts.sh @@ -55,6 +55,7 @@ build_artifact_version 2.7 build_artifact_version 3.6 build_artifact_version 3.7 build_artifact_version 3.8 +build_artifact_version 3.9 # python OSX10.9 does not have python 3.5 export MB_PYTHON_OSX_VER=10.6 diff --git a/kokoro/release/python/windows/build_artifacts.bat b/kokoro/release/python/windows/build_artifacts.bat index 70a86a199c..b2adbe03f3 100644 --- a/kokoro/release/python/windows/build_artifacts.bat +++ b/kokoro/release/python/windows/build_artifacts.bat @@ -72,6 +72,16 @@ SET PYTHON_VERSION=3.8 SET PYTHON_ARCH=64 CALL build_single_artifact.bat || goto :error +SET PYTHON=C:\python39_32bit +SET PYTHON_VERSION=3.9 +SET PYTHON_ARCH=32 +CALL build_single_artifact.bat || goto :error + +SET PYTHON=C:\python39 +SET PYTHON_VERSION=3.9 +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 45843e1a09..3b60fe6a9f 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:\python38_32bit set vcplatform=Win32 if %PYTHON%==C:\python38 set generator=Visual Studio 14 Win64 if %PYTHON%==C:\python38 set vcplatform=x64 +if %PYTHON%==C:\python39_32bit set generator=Visual Studio 14 +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 + 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/python/setup.py b/python/setup.py index d003c969ab..49f744ec47 100755 --- a/python/setup.py +++ b/python/setup.py @@ -279,6 +279,8 @@ if __name__ == '__main__': "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", ], namespace_packages=['google'], packages=find_packages( diff --git a/python/tox.ini b/python/tox.ini index 56be1258ae..9fabb6ddbb 100644 --- a/python/tox.ini +++ b/python/tox.ini @@ -1,6 +1,6 @@ [tox] envlist = - py{27,33,34,35,36}-{cpp,python} + py{27,33,34,35,36,37,38,39}-{cpp,python} [testenv] usedevelop=true diff --git a/tests.sh b/tests.sh index 6d63aad30d..b2a0a527da 100755 --- a/tests.sh +++ b/tests.sh @@ -356,6 +356,10 @@ build_python38() { build_python_version py38-python } +build_python39() { + build_python_version py38-python +} + build_python_cpp() { internal_build_cpp export LD_LIBRARY_PATH=../src/.libs # for Linux @@ -408,6 +412,10 @@ build_python38_cpp() { build_python_cpp_version py38-cpp } +build_python39_cpp() { + build_python_cpp_version py38-cpp +} + build_python_compatibility() { internal_build_cpp # Use the unit-tests extracted from 2.5.0 to test the compatibility.