Dropped support for Python < 3.7 (#9480)

* Drop Python versions <3.7.

* Updated README to clarify that Python 3.7 is the minimum.

* Removed more Python 3.5-specific code.

Also changed tests to skip missing interpreters.

* Invoke tox directly instead of through Python.

Hopefully this will pick up python3.

* Updated java_stretch image to bullseye to get Python >= 3.7.

* Use jdk11 instead of jdk8.

* Installed python2 for gtest.

* Use "python3 -m venv" instead of "virtualenv."

* Install python3-venv.
pull/9479/head
Joshua Haberman 3 years ago committed by GitHub
parent b5ab0b7a18
commit 301d315dc4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      kokoro/linux/dockerfile/test/java_stretch/Dockerfile
  2. 18
      kokoro/linux/python36/build.sh
  3. 11
      kokoro/linux/python36/continuous.cfg
  4. 11
      kokoro/linux/python36/presubmit.cfg
  5. 18
      kokoro/linux/python36_cpp/build.sh
  6. 11
      kokoro/linux/python36_cpp/continuous.cfg
  7. 11
      kokoro/linux/python36_cpp/presubmit.cfg
  8. 10
      kokoro/release/python/windows/build_artifacts.bat
  9. 6
      kokoro/release/python/windows/build_single_artifact.bat
  10. 2
      python/README.md
  11. 4
      python/setup.py
  12. 4
      python/tox.ini
  13. 58
      tests.sh

@ -1,4 +1,7 @@
FROM debian:stretch
# Despite the name of this image, we are no longer on stretch.
# We should consider renaming this image, and/or evaluating what
# software versions we actually need.
FROM debian:bullseye
# Install dependencies. We start with the basic ones required to build protoc
# and the C++ build
@ -22,9 +25,11 @@ RUN apt-get update && apt-get install -y \
wget \
# Java dependencies
maven \
openjdk-8-jdk \
openjdk-11-jdk \
# Required for the gtest build.
python2 \
# Python dependencies
python3-setuptools \
python3-pip \
virtualenv \
python3-venv \
&& apt-get clean

@ -1,18 +0,0 @@
#!/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/python36
export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh
export OUTPUT_DIR=testoutput
export TEST_SET="python36"
./kokoro/linux/build_and_run_docker.sh

@ -1,11 +0,0 @@
# Config file for running tests in Kokoro
# Location of the build script in repository
build_file: "protobuf/kokoro/linux/python36/build.sh"
timeout_mins: 120
action {
define_artifacts {
regex: "**/sponge_log.xml"
}
}

@ -1,11 +0,0 @@
# Config file for running tests in Kokoro
# Location of the build script in repository
build_file: "protobuf/kokoro/linux/python36/build.sh"
timeout_mins: 120
action {
define_artifacts {
regex: "**/sponge_log.xml"
}
}

@ -1,18 +0,0 @@
#!/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/python36
export DOCKER_RUN_SCRIPT=kokoro/linux/pull_request_in_docker.sh
export OUTPUT_DIR=testoutput
export TEST_SET="python36_cpp"
./kokoro/linux/build_and_run_docker.sh

@ -1,11 +0,0 @@
# Config file for running tests in Kokoro
# Location of the build script in repository
build_file: "protobuf/kokoro/linux/python36_cpp/build.sh"
timeout_mins: 120
action {
define_artifacts {
regex: "**/sponge_log.xml"
}
}

@ -1,11 +0,0 @@
# Config file for running tests in Kokoro
# Location of the build script in repository
build_file: "protobuf/kokoro/linux/python36_cpp/build.sh"
timeout_mins: 120
action {
define_artifacts {
regex: "**/sponge_log.xml"
}
}

@ -40,16 +40,6 @@ mkdir %ARTIFACT_DIR%
REM Build wheel
SET PYTHON=C:\python36_32bit
SET PYTHON_VERSION=3.6
SET PYTHON_ARCH=32
CALL build_single_artifact.bat || goto :error
SET PYTHON=C:\python36
SET PYTHON_VERSION=3.6
SET PYTHON_ARCH=64
CALL build_single_artifact.bat || goto :error
SET PYTHON=C:\python37_32bit
SET PYTHON_VERSION=3.7
SET PYTHON_ARCH=32

@ -1,11 +1,5 @@
setlocal
if %PYTHON%==C:\python36_32bit set generator=Visual Studio 14
if %PYTHON%==C:\python36_32bit set vcplatform=Win32
if %PYTHON%==C:\python36 set generator=Visual Studio 14 Win64
if %PYTHON%==C:\python36 set vcplatform=x64
if %PYTHON%==C:\python37_32bit set generator=Visual Studio 14
if %PYTHON%==C:\python37_32bit set vcplatform=Win32

@ -26,7 +26,7 @@ use python c++ implementation.
Installation
============
1) Make sure you have Python 3.5 or newer. If in doubt, run:
1) Make sure you have Python 3.7 or newer. If in doubt, run:
$ python -V

@ -301,8 +301,6 @@ if __name__ == '__main__':
classifiers=[
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"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",
@ -323,5 +321,5 @@ if __name__ == '__main__':
},
install_requires=install_requires,
ext_modules=ext_module_list,
python_requires=">=3.5",
python_requires=">=3.7",
)

@ -1,6 +1,6 @@
[tox]
envlist =
py{35,36,37,38,39,310}-{cpp,python}
py{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,310}-cpp: python setup.py -q build --cpp_implementation --warnings_as_errors --compile_static_extension
py{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

@ -116,12 +116,12 @@ build_dist_install() {
# Try to install Java
pushd java
use_java jdk8
use_java jdk11
$MVN install
popd
# Try to install Python
virtualenv --no-site-packages venv
python3 -m venv venv
source venv/bin/activate
pushd python
python3 setup.py clean build sdist
@ -189,6 +189,10 @@ build_golang() {
use_java() {
version=$1
case "$version" in
jdk11)
export PATH=/usr/lib/jvm/java-11-openjdk-amd64/bin:$PATH
export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
;;
jdk8)
export PATH=/usr/lib/jvm/java-8-openjdk-amd64/bin:$PATH
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
@ -268,7 +272,7 @@ build_java_linkage_monitor() {
# Linkage Monitor checks compatibility with other Google libraries
# https://github.com/GoogleCloudPlatform/cloud-opensource-java/tree/master/linkage-monitor
use_java jdk8
use_java jdk11
internal_build_cpp
# Linkage Monitor uses $HOME/.m2 local repository
@ -330,12 +334,7 @@ build_objectivec_cocoapods_integration() {
build_python() {
internal_build_cpp
cd python
if [ $(uname -s) == "Linux" ]; then
envlist=py\{35,36\}-python
else
envlist=py\{36\}-python
fi
python -m tox -e $envlist
tox --skip-missing-interpreters
cd ..
}
@ -343,26 +342,10 @@ build_python_version() {
internal_build_cpp
cd python
envlist=$1
python -m tox -e $envlist
tox -e $envlist
cd ..
}
build_python33() {
build_python_version py33-python
}
build_python34() {
build_python_version py34-python
}
build_python35() {
build_python_version py35-python
}
build_python36() {
build_python_version py36-python
}
build_python37() {
build_python_version py37-python
}
@ -384,12 +367,7 @@ build_python_cpp() {
export LD_LIBRARY_PATH=../src/.libs # for Linux
export DYLD_LIBRARY_PATH=../src/.libs # for OS X
cd python
if [ $(uname -s) == "Linux" ]; then
envlist=py\{35,36\}-cpp
else
envlist=py\{36\}-cpp
fi
tox -e $envlist
tox --skip-missing-interpreters
cd ..
}
@ -403,22 +381,6 @@ build_python_cpp_version() {
cd ..
}
build_python33_cpp() {
build_python_cpp_version py33-cpp
}
build_python34_cpp() {
build_python_cpp_version py34-cpp
}
build_python35_cpp() {
build_python_cpp_version py35-cpp
}
build_python36_cpp() {
build_python_cpp_version py36-cpp
}
build_python37_cpp() {
build_python_cpp_version py37-cpp
}

Loading…
Cancel
Save