Using this package requires that you install the Kudu C++ client libraries and headers. See https://kudu.apache.org for more.
Before installing the Python client, you need to install OS-specific system dependencies.
The Kudu Python client requires several packages that vary by operating system (Debian/Ubuntu, CentOS/RHEL, OpenSUSE/SLES). These include build tools like setuptools and the Python development package.
For automated installation of these dependencies, you can use the bootstrap script: https://github.com/apache/kudu/blob/master/docker/bootstrap-python-env.sh
Note: It is recommended to use a Python virtual environment to avoid conflicts with system packages.
If you don't have virtualenv installed, you can learn more and install it from the official virtualenv website.
# Create a virtual environment
# You can use any Python version supported by kudu-python (check https://pypi.org/project/kudu-python/)
virtualenv venv -p 3.8
# Activate the virtual environment
source venv/bin/activate
# To deactivate later:
deactivatepip install kudu-pythonNote: Make sure you are in the kudu/python directory where the requirements files are located.
cd /path/to/kudu/python # Navigate to the python directory if not already there
pip install -r requirements.txt
python setup.py sdist
pip install dist/kudu-python-*.tar.gzBefore building for development, you need to set the KUDU_HOME environment variable to point to the root directory of your Kudu git repository:
export KUDU_HOME=/path/to/kuduThis variable is required by various scripts and tools in the project. Make sure it's set in your environment before running any Kudu-related commands.
Note: Make sure you are in the kudu/python directory where the requirements files are located.
cd $KUDU_HOME/python # Navigate to the python directory if not already there
pip install -r requirements.txt
pip install -r requirements_dev.txt
python setup.py build_ext --inplacepython setup.py testpython -m unittest kudu.tests.test_client.TestClient.test_list_tablesTo debug a specific test using Python's built-in debugger (pdb):
python -m pdb -m unittest kudu.tests.test_client.TestClient.test_list_tablesThis will start the debugger before running the test, allowing you to set breakpoints and step through the code.
A Makefile is provided to simplify common development tasks. It includes targets for building, installing dependencies, running tests, and cleaning the project.
# Install all dependencies
make requirements
# Build the extension in-place
make build
# Run all tests
make test
# Run a specific test
make test TEST=kudu.tests.test_client.TestClient.test_list_tables
# Clean build artifacts
make clean