Just install ytsaurus-client
using pip
.
Detailed documentation can be found here.
In this README we will be assuming you are not root.
We suppose that you use venv for python playground: how to install it.
Let call project checkout directory as <source_root>
and project build directory as <build_root>
.
export SOURCE_ROOT=<source_root>
export BUILD_ROOT=<build_root>
To work with ytsaurus python libraries you should prepare environment and modules:
- Build native libraries presented by cmake targets
yson_lib
,driver_lib
,driver_rpc_lib
cd "$BUILD_ROOT" && ninja yson_lib driver_lib driver_rpc_lib
- Create directory to store prepared modules, let call it <ytsaurus_python>
mkdir "$YTSAURUS_PYTHON"
-
Install wheel package
pip3 install wheel
-
Install
yt_setup
package in editable mode, this library provide instruments to prepare modules layout.
cd "$SOURCE_ROOT" && pip install -e yt/python/packages
- Run
generate_python_proto
to build proto modules (it requires protoc to be installed, see build instruction).
generate_python_proto --source-root "$SOURCE_ROOT" --output "$YTSAURUS_PYTHON"`
- Run
prepare_python_modules
to prepare all python modules
prepare_python_modules --source-root "$SOURCE_ROOT" --build-root "$BUILD_ROOT" --output-path "$YTSAURUS_PYTHON" --prepare-bindings-libraries`
After that ytsaurus python libraries can be used by adding <ytsaurus_python>
to PYTHONPATH.
To build package you need to copy setup.py
from yt/python/packages/<package_name>/
to the <ytsaurus_python>
and run setup script.
For pure python libraries (ytsaurus-client, ytsaurus-local) you should run python3 setup.py bdist_wheel --universal
, for binary libraries (ytsaurus-yson, ytsaurus-rpc-driver) you should run python3 setup.py bdist_wheel --py-limited-api cp34
You will find wheel files .whl files in $YTSAURUS_PYTHON/dist
directory, alternatively you can specify --dist-dir
option.