Skip to content

Commit

Permalink
remove python2 support
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiayu Liu committed Oct 27, 2022
1 parent 2acfe0f commit 5fa00ec
Show file tree
Hide file tree
Showing 49 changed files with 394 additions and 479 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ jobs:
--without-c_glib \
--without-java \
--without-kotlin \
--without-python \
--without-py3 \
--without-ruby \
--without-haxe \
Expand Down Expand Up @@ -189,7 +188,6 @@ jobs:
--without-c_glib \
--with-java \
--with-kotlin \
--without-python \
--without-py3 \
--without-ruby \
--without-haxe \
Expand Down Expand Up @@ -288,7 +286,6 @@ jobs:
--without-c_glib \
--without-java \
--without-kotlin \
--without-python \
--without-py3 \
--without-ruby \
--without-haxe \
Expand Down Expand Up @@ -365,7 +362,6 @@ jobs:
--without-c_glib \
--without-java \
--without-kotlin \
--without-python \
--without-py3 \
--without-ruby \
--without-haxe \
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ jobs:
env:
- JOB="UBSan"
- SCRIPT="ubsan.sh"
- BUILD_ARG="--without-python --without-py3"
- BUILD_ARG="--without-py3"

# ------------------------- phase: autotools --------------------
# TODO: Remove them once migrated to CMake
Expand Down
9 changes: 2 additions & 7 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,11 @@ empty :=
space := $(empty) $(empty)
comma := ,

CROSS_LANGS = @MAYBE_CPP@ @MAYBE_C_GLIB@ @MAYBE_CL@ @MAYBE_D@ @MAYBE_JAVA@ @MAYBE_PYTHON@ @MAYBE_PY3@ @MAYBE_RUBY@ @MAYBE_PERL@ @MAYBE_PHP@ @MAYBE_GO@ @MAYBE_NODEJS@ @MAYBE_DART@ @MAYBE_ERLANG@ @MAYBE_LUA@ @MAYBE_RS@ @MAYBE_NETSTD@ @MAYBE_NODETS@ @MAYBE_KOTLIN@ @MAYBE_SWIFT@
CROSS_LANGS = @MAYBE_CPP@ @MAYBE_C_GLIB@ @MAYBE_CL@ @MAYBE_D@ @MAYBE_JAVA@ @MAYBE_PY3@ @MAYBE_RUBY@ @MAYBE_PERL@ @MAYBE_PHP@ @MAYBE_GO@ @MAYBE_NODEJS@ @MAYBE_DART@ @MAYBE_ERLANG@ @MAYBE_LUA@ @MAYBE_RS@ @MAYBE_NETSTD@ @MAYBE_NODETS@ @MAYBE_KOTLIN@ @MAYBE_SWIFT@
CROSS_LANGS_COMMA_SEPARATED = $(subst $(space),$(comma),$(CROSS_LANGS))

if WITH_PY3
CROSS_PY=$(PYTHON3)
else
CROSS_PY=$(PYTHON)
endif

if WITH_PYTHON
if WITH_PY3
crossfeature: precross
$(CROSS_PY) test/test.py --retry-count 5 --features .* --skip-known-failures --server $(CROSS_LANGS_COMMA_SEPARATED)
else
Expand Down
2 changes: 1 addition & 1 deletion build/appveyor/CYGWIN-appveyor-full.bat
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ SET CMAKEARGS=^
-DCMAKE_INSTALL_PREFIX=%INSTDIR% ^
-DCMAKE_CXX_FLAGS="-D_GNU_SOURCE" ^
-DWITH_JAVA=OFF ^
-DWITH_PYTHON=OFF
-DWITH_PY3=OFF

:: -DCMAKE_CXX_EXTENSIONS=ON ^
:: -DCMAKE_CXX_STANDARD=11 ^
Expand Down
2 changes: 1 addition & 1 deletion build/appveyor/MINGW-appveyor-full.bat
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ SET CMAKEARGS=^
-DCMAKE_C_COMPILER=/mingw%NORM_PLATFORM%/bin/gcc.exe ^
-DCMAKE_CXX_COMPILER=/mingw%NORM_PLATFORM%/bin/g++.exe ^
-DOPENSSL_ROOT_DIR=/mingw%NORM_PLATFORM% ^
-DWITH_PYTHON=OFF
-DWITH_PY3=OFF

%BASH% -lc "mkdir -p %BUILDDIR% && cd %BUILDDIR% && cmake.exe %SRCDIR% %CMAKEARGS% && cmake --build . --config %CONFIGURATION% && cmake --install . --config %CONFIGURATION%" || EXIT /B

Expand Down
6 changes: 3 additions & 3 deletions build/appveyor/MSVC-appveyor-full.bat
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ SET OPENSSL_ROOT=C:\OpenSSL-Win%NORM_PLATFORM%
SET WIN3P=%APPVEYOR_BUILD_FOLDER%\thirdparty

IF "%PYTHON_VERSION%" == "" (
SET WITH_PYTHON=OFF
SET WITH_PY3=OFF
) ELSE (
SET WITH_PYTHON=ON
SET WITH_PY3=ON
IF /i "%PLATFORM%" == "x64" (SET PTEXT=-x64)
SET PATH=C:\Python%PYTHON_VERSION:.=%!PTEXT!\scripts;C:\Python%PYTHON_VERSION:.=%!PTEXT!;!PATH!
)
Expand Down Expand Up @@ -179,7 +179,7 @@ cmake.exe "%SRCDIR%" ^
-DOPENSSL_USE_STATIC_LIBS=OFF ^
-DZLIB_LIBRARY="%WIN3P%\zlib-inst\lib\zlib%ZLIB_LIB_SUFFIX%.lib" ^
-DZLIB_ROOT="%WIN3P%\zlib-inst" ^
-DWITH_PYTHON=%WITH_PYTHON% || EXIT /B
-DWITH_PY3=%WITH_PY3% || EXIT /B

cmake.exe --build . --config "%CONFIGURATION%" || EXIT /B

Expand Down
2 changes: 1 addition & 1 deletion build/appveyor/MSYS-appveyor-full.bat
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ SET CMAKEARGS=^
-DWITH_BOOST_STATIC=ON ^
-DWITH_JAVA=OFF ^
-DWITH_LIBEVENT=ON ^
-DWITH_PYTHON=%WITH_PYTHON% ^
-DWITH_PY3=%WITH_PY3% ^
-DWITH_SHARED_LIB=OFF ^
-DWITH_STATIC_LIB=ON

Expand Down
2 changes: 1 addition & 1 deletion build/appveyor/win_showenv.bat
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ ECHO OPENSSL_ROOT = %OPENSSL_ROOT%
ECHO SETUP = %SETUP%
ECHO SRCDIR = %SRCDIR%
ECHO WIN3P = %WIN3P%
ECHO WITH_PYTHON = %WITH_PYTHON%
ECHO WITH_PY3 = %WITH_PY3%
ECHO ZLIB_STATIC_SUFFIX = %ZLIB_STATIC_SUFFIX%
IF NOT "%PROFILE_CLASS%" == "MSVC" (
ECHO/
Expand Down
7 changes: 4 additions & 3 deletions build/cmake/DefineOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,12 @@ CMAKE_DEPENDENT_OPTION(BUILD_NODEJS "Build NodeJS library" ON
"BUILD_LIBRARIES;WITH_NODEJS" OFF)

# Python
option(WITH_PYTHON "Build Python Thrift library" ON)
option(WITH_PY3 "Build Python Thrift library" ON)
set(Python_ADDITIONAL_VERSIONS 3.7 3.8 3.9 3.10)
find_package(PythonInterp QUIET) # for Python executable
find_package(PythonLibs QUIET) # for Python.h
CMAKE_DEPENDENT_OPTION(BUILD_PYTHON "Build Python library" ON
"BUILD_LIBRARIES;WITH_PYTHON;PYTHONINTERP_FOUND;PYTHONLIBS_FOUND" OFF)
"BUILD_LIBRARIES;WITH_PY3;PYTHONINTERP_FOUND;PYTHONLIBS_FOUND" OFF)

# Common library options
# https://cmake.org/cmake/help/latest/variable/BUILD_SHARED_LIBS.html
Expand Down Expand Up @@ -205,7 +206,7 @@ message(STATUS " Build NodeJS library: ${BUILD_NODEJS}")
MESSAGE_DEP(WITH_NODEJS "Disabled by WITH_NODEJS=OFF")
message(STATUS)
message(STATUS " Build Python library: ${BUILD_PYTHON}")
MESSAGE_DEP(WITH_PYTHON "Disabled by WITH_PYTHON=OFF")
MESSAGE_DEP(WITH_PY3 "Disabled by WITH_PY3=OFF")
MESSAGE_DEP(PYTHONLIBS_FOUND "Python libraries missing")
if(MSVC)
message(STATUS " Using static runtime library: ${WITH_MT}")
Expand Down
2 changes: 1 addition & 1 deletion build/cmake/README-MSYS2.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Use cmake to create a MinGW makefile, out of tree (assumes you are in the top le
-DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++.exe \
-DWITH_LIBEVENT=OFF \
-DWITH_SHARED_LIB=OFF -DWITH_STATIC_LIB=ON \
-DWITH_JAVA=OFF -DWITH_PYTHON=OFF -DWITH_PERL=OFF \
-DWITH_JAVA=OFF -DWITH_PY3=OFF -DWITH_PERL=OFF \
../thrift

Build thrift (inside thrift-build):
Expand Down
3 changes: 1 addition & 2 deletions build/docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,7 @@ Last updated: October 1, 2017
| ocaml | | 4.05.0 | THRIFT-4517: ocaml 4.02.3 on xenial appears broken |
| perl | 5.22.1 | 5.26.1 | |
| php | 7.0.32 | 7.2.19 | |
| python | 2.7.12 | 2.7.15 | |
| python3 | 3.5.2 | 3.6.8 | |
| python3 | 3.5 | 3.6 | |
| ruby | 2.3.1p112 | 2.5.1p57 | |
| rust | 1.61.0 | 1.61.0 | |
| smalltalk | | | Not in CI |
Expand Down
20 changes: 3 additions & 17 deletions build/docker/ubuntu-bionic/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -219,21 +219,6 @@ RUN apt-get install -y --no-install-recommends \
re2c \
composer

RUN apt-get install -y --no-install-recommends \
`# Python dependencies` \
python-all \
python-all-dbg \
python-all-dev \
python-ipaddress \
python-pip \
python-setuptools \
python-six \
python-tornado \
python-twisted \
python-wheel \
python-zope.interface && \
pip install --upgrade backports.ssl_match_hostname

RUN apt-get install -y --no-install-recommends \
`# Python3 dependencies` \
python3-all \
Expand All @@ -245,7 +230,8 @@ RUN apt-get install -y --no-install-recommends \
python3-tornado \
python3-twisted \
python3-wheel \
python3-zope.interface
python3-zope.interface && \
python3 -m pip install --upgrade pip

RUN apt-get install -y --no-install-recommends \
`# Ruby dependencies` \
Expand Down Expand Up @@ -281,7 +267,7 @@ RUN apt-get install -y --no-install-recommends \
`# Static Code Analysis dependencies` \
cppcheck \
sloccount && \
pip install flake8
python3 -m pip install flake8==4.0.1

# NOTE: this does not reduce the image size but adds an additional layer.
# # Clean up
Expand Down
Loading

0 comments on commit 5fa00ec

Please sign in to comment.