Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop building Pulsar Client for Python 2.7 #14827

Closed

Conversation

michaeljmarshall
Copy link
Member

Motivation

We currently have several dependencies on Python 2.7. There is no need to build anything new for Python 2.7, as it has been deprecated for a while.

Modifications

  • Remove the defunct homebrew script (the real one lives upstream).
  • Update comments to indicate supported python languages.
  • Update the python client build so that it only releases clients for python 3.x.

Verifying this change

I have manually run the scripts for these components to verify that the tests pass.

Does this pull request potentially affect one of the following parts:

Yes, this is a breaking change for the python 2.7 client. Given that python 2.7 is no longer supported, this is an acceptable breaking change.

Documentation

  • doc

There are some minor doc updates as a part of this PR.

@michaeljmarshall michaeljmarshall added doc Your PR contains doc changes, no matter whether the changes are in markdown or code files. component/client-python labels Mar 23, 2022
@michaeljmarshall michaeljmarshall added this to the 2.11.0 milestone Mar 23, 2022
@michaeljmarshall michaeljmarshall self-assigned this Mar 23, 2022
@@ -87,7 +87,7 @@ jobs:
if: ${{ steps.check_changes.outputs.docs_only != 'true' }}
run: |
echo "Build C++ client library"
export CMAKE_ARGS="-DCMAKE_BUILD_TYPE=Debug -DBUILD_DYNAMIC_LIB=OFF -DPYTHON_INCLUDE_DIR=/usr/include/python2.7 -DPYTHON_LIBRARY=/usr/lib/x86_64-linux-gnu/libpython2.7.so"
export CMAKE_ARGS="-DCMAKE_BUILD_TYPE=Debug -DBUILD_DYNAMIC_LIB=OFF -DPYTHON_INCLUDE_DIR=/usr/include/python3.5m -DPYTHON_LIBRARY=/usr/lib/x86_64-linux-gnu/libpython3.5m.so"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am having trouble with this test. I get the following error when running in a docker container on my laptop:

root@a89a873f16b0:/pulsar/pulsar-client-cpp# cd /pulsar/pulsar-client-cpp && cmake . $CMAKE_ARGS && make check-format && make -j8
-- ARCHITECTURE: x86_64
-- BUILD_DYNAMIC_LIB:  OFF
-- BUILD_STATIC_LIB:  ON
-- BUILD_TESTS:  ON
-- BUILD_PYTHON_WRAPPER:  ON
-- BUILD_WIRESHARK:  OFF
-- BUILD_PERF_TOOLS:  OFF
-- LINK_STATIC:  OFF
-- USE_LOG4CXX:  OFF
-- CMAKE_BUILD_TYPE:  Debug
-- Threads library: -pthread
Failed to find Protobuf in config mode, try to find it from system path
-- Protobuf_LIBRARIES: /usr/local/lib/libprotobuf.so
-- Protobuf_INCLUDE_DIRS: /usr/local/include
-- Found Boost: /usr/include (found version "1.58.0")  
-- Linking with Boost:System
-- Using std::regex
-- Found Boost: /usr/include (found version "1.58.0") found components: system 
-- PYTHON: 3.5.2
-- DETECTED Python 3
CMake Warning at /cmake-3.22.0-linux-x86_64/share/cmake-3.22/Modules/FindBoost.cmake:2201 (message):
  No header defined for python3-mt; skipping header check (note: header-only
  libraries have no designated component)
Call Stack (most recent call first):
  CMakeLists.txt:280 (find_package)


CMake Warning at /cmake-3.22.0-linux-x86_64/share/cmake-3.22/Modules/FindBoost.cmake:2201 (message):
  No header defined for python-py35; skipping header check (note: header-only
  libraries have no designated component)
Call Stack (most recent call first):
  CMakeLists.txt:280 (find_package)


CMake Warning at /cmake-3.22.0-linux-x86_64/share/cmake-3.22/Modules/FindBoost.cmake:2201 (message):
  No header defined for python-py35; skipping header check (note: header-only
  libraries have no designated component)
Call Stack (most recent call first):
  CMakeLists.txt:291 (find_package)


-- Found Boost: /usr/include (found version "1.58.0") found components: python-py35 
-- HAS_ZSTD: 1
-- HAS_SNAPPY: 1
-- Using Boost Python libs: 
CMake Error at python/CMakeLists.txt:84 (MESSAGE):
  Could not find Boost Python library


-- Configuring incomplete, errors occurred!
See also "/pulsar/pulsar-client-cpp/CMakeFiles/CMakeOutput.log".
See also "/pulsar/pulsar-client-cpp/CMakeFiles/CMakeError.log".

It is likely that apachepulsar/pulsar-build:ubuntu-16.04-pb3 does not have the correct dependencies.

@BewareMyPower
Copy link
Contributor

I've tried to enable Python3 for CI some months ago, see #9684 and #8624. It's harder than I've thought.

It's right that the apachepulsar/pulsar-build:ubuntu-16.04-pb3 image doesn't have the Python3 support. We need to update the Dockerfile and add Boost Python3 dependency. But the most hard thing is the Python Functions incompatibility. It looks like Python Functions relies heavy on Python2.

@michaeljmarshall
Copy link
Member Author

@BewareMyPower - thank you for the additional context!

@michaeljmarshall
Copy link
Member Author

Superseded by #15185.

@michaeljmarshall michaeljmarshall deleted the remove-python-2.7-build branch April 19, 2022 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Your PR contains doc changes, no matter whether the changes are in markdown or code files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants