From a33aa736fc71d56916788c604b4504854cb49a80 Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Thu, 9 Sep 2021 13:20:34 -0700 Subject: [PATCH] Removed more testing of Python <3.5. --- conformance/Makefile.am | 18 ++-------- .../text_format_failure_list_python_2.7.txt | 36 ------------------- ...ext_format_failure_list_python_cpp_2.7.txt | 30 ---------------- .../linux/dockerfile/test/python27/Dockerfile | 31 ---------------- python/README.md | 2 +- python/setup.py | 2 +- python/tox.ini | 7 ++-- tests.sh | 16 +++------ 8 files changed, 10 insertions(+), 132 deletions(-) delete mode 100644 conformance/text_format_failure_list_python_2.7.txt delete mode 100644 conformance/text_format_failure_list_python_cpp_2.7.txt delete mode 100644 kokoro/linux/dockerfile/test/python27/Dockerfile diff --git a/conformance/Makefile.am b/conformance/Makefile.am index b281f9cfaa..b79b12d1f1 100644 --- a/conformance/Makefile.am +++ b/conformance/Makefile.am @@ -359,24 +359,10 @@ test_php_c: protoc_middleman conformance-test-runner conformance-php-c $(other_l # These depend on library paths being properly set up. The easiest way to # run them is to just use "tox" from the python dir. test_python: protoc_middleman conformance-test-runner - VERSION="$(shell python --version 2>&1)"; \ - if [[ "$$VERSION" == "Python 2.7"* ]]; then \ - echo "Using Python 2.7 failure list."; \ - ./conformance-test-runner --enforce_recommended --failure_list failure_list_python.txt --text_format_failure_list text_format_failure_list_python_2.7.txt ./conformance_python.py; \ - else \ - echo "Using Python >2.7 failure list."; \ - ./conformance-test-runner --enforce_recommended --failure_list failure_list_python.txt --text_format_failure_list text_format_failure_list_python.txt ./conformance_python.py; \ - fi + ./conformance-test-runner --enforce_recommended --failure_list failure_list_python.txt --text_format_failure_list text_format_failure_list_python.txt ./conformance_python.py; \ test_python_cpp: protoc_middleman conformance-test-runner - VERSION="$(shell python --version 2>&1)"; \ - if [[ "$$VERSION" == "Python 2.7"* ]]; then \ - echo "Using Python 2.7 failure list."; \ - ./conformance-test-runner --enforce_recommended --failure_list failure_list_python_cpp.txt --text_format_failure_list text_format_failure_list_python_cpp_2.7.txt ./conformance_python.py; \ - else \ - echo "Using Python >2.7 failure list."; \ - ./conformance-test-runner --enforce_recommended --failure_list failure_list_python_cpp.txt --text_format_failure_list text_format_failure_list_python_cpp.txt ./conformance_python.py; \ - fi + ./conformance-test-runner --enforce_recommended --failure_list failure_list_python_cpp.txt --text_format_failure_list text_format_failure_list_python_cpp.txt ./conformance_python.py; \ test_nodejs: protoc_middleman conformance-test-runner $(other_language_protoc_outputs) NODE_PATH=../js:. ./conformance-test-runner --enforce_recommended --failure_list failure_list_js.txt ./conformance_nodejs.js diff --git a/conformance/text_format_failure_list_python_2.7.txt b/conformance/text_format_failure_list_python_2.7.txt deleted file mode 100644 index cada2bc03b..0000000000 --- a/conformance/text_format_failure_list_python_2.7.txt +++ /dev/null @@ -1,36 +0,0 @@ -# This is the list of text format conformance tests that are known to fail right -# now. -# TODO: These should be fixed. -Required.Proto3.TextFormatInput.FloatFieldMaxValue.ProtobufOutput -Required.Proto3.TextFormatInput.FloatFieldMaxValue.TextFormatOutput - -Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateFirstOnlyBytes -Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateFirstOnlyString -Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogatePairBytes -Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogatePairString -Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateSecondOnlyBytes -Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateSecondOnlyString -Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapesBytes.ProtobufOutput -Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapesBytes.TextFormatOutput -Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapesString.ProtobufOutput -Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapesString.TextFormatOutput -Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeBytes.ProtobufOutput -Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeBytes.TextFormatOutput -Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeString.ProtobufOutput -Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeString.TextFormatOutput -Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateFirstOnlyBytes -Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateFirstOnlyString -Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogatePairBytes -Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogatePairString -Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateSecondOnlyBytes -Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateSecondOnlyString -Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairLongShortBytes -Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairLongShortString -Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairShortLongBytes -Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairShortLongString -Required.Proto3.TextFormatInput.StringLiteralBasicEscapesBytes.ProtobufOutput -Required.Proto3.TextFormatInput.StringLiteralBasicEscapesBytes.TextFormatOutput -Required.Proto3.TextFormatInput.StringLiteralBasicEscapesString.ProtobufOutput -Required.Proto3.TextFormatInput.StringLiteralBasicEscapesString.TextFormatOutput -Required.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeTooLargeBytes -Required.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeTooLargeString diff --git a/conformance/text_format_failure_list_python_cpp_2.7.txt b/conformance/text_format_failure_list_python_cpp_2.7.txt deleted file mode 100644 index ba2089bcaa..0000000000 --- a/conformance/text_format_failure_list_python_cpp_2.7.txt +++ /dev/null @@ -1,30 +0,0 @@ -Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateFirstOnlyBytes -Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateFirstOnlyString -Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogatePairBytes -Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogatePairString -Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateSecondOnlyBytes -Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateSecondOnlyString -Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapesBytes.ProtobufOutput -Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapesBytes.TextFormatOutput -Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapesString.ProtobufOutput -Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapesString.TextFormatOutput -Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeBytes.ProtobufOutput -Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeBytes.TextFormatOutput -Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeString.ProtobufOutput -Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeString.TextFormatOutput -Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateFirstOnlyBytes -Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateFirstOnlyString -Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogatePairBytes -Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogatePairString -Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateSecondOnlyBytes -Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateSecondOnlyString -Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairLongShortBytes -Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairLongShortString -Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairShortLongBytes -Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairShortLongString -Required.Proto3.TextFormatInput.StringLiteralBasicEscapesBytes.ProtobufOutput -Required.Proto3.TextFormatInput.StringLiteralBasicEscapesBytes.TextFormatOutput -Required.Proto3.TextFormatInput.StringLiteralBasicEscapesString.ProtobufOutput -Required.Proto3.TextFormatInput.StringLiteralBasicEscapesString.TextFormatOutput -Required.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeTooLargeBytes -Required.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeTooLargeString diff --git a/kokoro/linux/dockerfile/test/python27/Dockerfile b/kokoro/linux/dockerfile/test/python27/Dockerfile deleted file mode 100644 index 6b0eaf72c8..0000000000 --- a/kokoro/linux/dockerfile/test/python27/Dockerfile +++ /dev/null @@ -1,31 +0,0 @@ -FROM python:2.7-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/python/README.md b/python/README.md index 31e649c715..f0c9ce4f44 100644 --- a/python/README.md +++ b/python/README.md @@ -26,7 +26,7 @@ use python c++ implementation. Installation ============ -1) Make sure you have Python 2.7 or newer. If in doubt, run: +1) Make sure you have Python 3.5 or newer. If in doubt, run: $ python -V diff --git a/python/setup.py b/python/setup.py index 77a6c4a1bd..e531b89168 100755 --- a/python/setup.py +++ b/python/setup.py @@ -254,7 +254,7 @@ if __name__ == '__main__': os.environ['PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION'] = 'cpp' # Keep this list of dependencies in sync with tox.ini. - install_requires = ['six>=1.9'] + install_requires = [] setup( name='protobuf', diff --git a/python/tox.ini b/python/tox.ini index eab095c0d0..88dd842e82 100644 --- a/python/tox.ini +++ b/python/tox.ini @@ -1,6 +1,6 @@ [tox] envlist = - py{33,34,35,36,37,38,39}-{cpp,python} + py{35,36,37,38,39}-{cpp,python} [testenv] usedevelop=true @@ -14,11 +14,8 @@ setenv = commands = python setup.py -q build_py python: python setup.py -q build - py{33,34,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}-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 cpp: python setup.py -q test_conformance --cpp_implementation -deps = - # Keep this list of dependencies in sync with setup.py. - six>=1.9 diff --git a/tests.sh b/tests.sh index 04d49c6ea1..1955b7bdf9 100755 --- a/tests.sh +++ b/tests.sh @@ -312,9 +312,9 @@ build_python() { internal_build_cpp cd python if [ $(uname -s) == "Linux" ]; then - envlist=py\{27,33,34,35,36\}-python + envlist=py\{35,36\}-python else - envlist=py\{27,36\}-python + envlist=py\{36\}-python fi python -m tox -e $envlist cd .. @@ -328,10 +328,6 @@ build_python_version() { cd .. } -build_python27() { - build_python_version py27-python -} - build_python33() { build_python_version py33-python } @@ -366,9 +362,9 @@ build_python_cpp() { export DYLD_LIBRARY_PATH=../src/.libs # for OS X cd python if [ $(uname -s) == "Linux" ]; then - envlist=py\{27,33,34,35,36\}-cpp + envlist=py\{35,36\}-cpp else - envlist=py\{27,36\}-cpp + envlist=py\{36\}-cpp fi tox -e $envlist cd .. @@ -384,10 +380,6 @@ build_python_cpp_version() { cd .. } -build_python27_cpp() { - build_python_cpp_version py27-cpp -} - build_python33_cpp() { build_python_cpp_version py33-cpp }