Ver Fonte

add python38 (#7009)

* add python38

* add python3.8

* fix tox
Jie Luo há 5 anos atrás
pai
commit
7faab5eeeb

+ 2 - 0
kokoro/linux/dockerfile/test/python_stretch/Dockerfile

@@ -40,8 +40,10 @@ RUN apt-get update && apt-get -t testing install -y \
   python3.5 \
   python3.5 \
   python3.6 \
   python3.6 \
   python3.7 \
   python3.7 \
+  python3.8 \
   python3-all-dev
   python3-all-dev
 
 
 RUN curl https://bootstrap.pypa.io/get-pip.py | python3.5
 RUN curl https://bootstrap.pypa.io/get-pip.py | python3.5
 RUN curl https://bootstrap.pypa.io/get-pip.py | python3.6
 RUN curl https://bootstrap.pypa.io/get-pip.py | python3.6
 RUN curl https://bootstrap.pypa.io/get-pip.py | python3.7
 RUN curl https://bootstrap.pypa.io/get-pip.py | python3.7
+RUN curl https://bootstrap.pypa.io/get-pip.py | python3.8

+ 18 - 0
kokoro/linux/python38/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/python_stretch
+export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh
+export OUTPUT_DIR=testoutput
+export TEST_SET="python38"
+./kokoro/linux/build_and_run_docker.sh

+ 11 - 0
kokoro/linux/python38/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/python/build.sh"
+timeout_mins: 120
+
+action {
+  define_artifacts {
+    regex: "**/sponge_log.xml"
+  }
+}

+ 11 - 0
kokoro/linux/python38/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/python/build.sh"
+timeout_mins: 120
+
+action {
+  define_artifacts {
+    regex: "**/sponge_log.xml"
+  }
+}

+ 18 - 0
kokoro/linux/python38_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/python_stretch
+export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh
+export OUTPUT_DIR=testoutput
+export TEST_SET="python38_cpp"
+./kokoro/linux/build_and_run_docker.sh

+ 11 - 0
kokoro/linux/python38_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/python_cpp/build.sh"
+timeout_mins: 120
+
+action {
+  define_artifacts {
+    regex: "**/sponge_log.xml"
+  }
+}

+ 11 - 0
kokoro/linux/python38_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/python_cpp/build.sh"
+timeout_mins: 120
+
+action {
+  define_artifacts {
+    regex: "**/sponge_log.xml"
+  }
+}

+ 10 - 0
kokoro/release/python/windows/build_artifacts.bat

@@ -62,6 +62,16 @@ SET PYTHON_VERSION=3.7
 SET PYTHON_ARCH=64
 SET PYTHON_ARCH=64
 CALL build_single_artifact.bat || goto :error
 CALL build_single_artifact.bat || goto :error
 
 
+SET PYTHON=C:\python38_32bit
+SET PYTHON_VERSION=3.8
+SET PYTHON_ARCH=32
+CALL build_single_artifact.bat || goto :error
+
+SET PYTHON=C:\python38
+SET PYTHON_VERSION=3.8
+SET PYTHON_ARCH=64
+CALL build_single_artifact.bat || goto :error
+
 goto :EOF
 goto :EOF
 
 
 :error
 :error

+ 6 - 0
kokoro/release/python/windows/build_single_artifact.bat

@@ -18,6 +18,12 @@ if %PYTHON%==C:\python37_32bit set vcplatform=Win32
 if %PYTHON%==C:\python37 set generator=Visual Studio 14 Win64
 if %PYTHON%==C:\python37 set generator=Visual Studio 14 Win64
 if %PYTHON%==C:\python37 set vcplatform=x64
 if %PYTHON%==C:\python37 set vcplatform=x64
 
 
+if %PYTHON%==C:\python38_32bit set generator=Visual Studio 14
+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
+
 REM Prepend newly installed Python to the PATH of this build (this cannot be
 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 done from inside the powershell script as it would require to restart
 REM the parent CMD process).
 REM the parent CMD process).

+ 8 - 0
tests.sh

@@ -360,6 +360,10 @@ build_python37() {
   build_python_version py37-python
   build_python_version py37-python
 }
 }
 
 
+build_python38() {
+  build_python_version py38-python
+}
+
 build_python_cpp() {
 build_python_cpp() {
   internal_build_cpp
   internal_build_cpp
   export LD_LIBRARY_PATH=../src/.libs # for Linux
   export LD_LIBRARY_PATH=../src/.libs # for Linux
@@ -408,6 +412,10 @@ build_python37_cpp() {
   build_python_cpp_version py37-cpp
   build_python_cpp_version py37-cpp
 }
 }
 
 
+build_python38_cpp() {
+  build_python_cpp_version py38-cpp
+}
+
 build_python_compatibility() {
 build_python_compatibility() {
   internal_build_cpp
   internal_build_cpp
   # Use the unit-tests extraced from 2.5.0 to test the compatibilty.
   # Use the unit-tests extraced from 2.5.0 to test the compatibilty.