Zenoh Flow provides a Zenoh-based dataflow programming framework for computations that span from the cloud to the device.
- Rust: see the installation page
- a matching version of libpython. On linux systems, it's typically packaged separately as ``libpython3.x-dev
or
python3.x-dev`. - Python >= 3.7
- pip >= 22
- virtualenv
Create and activate a python virtual environment:
$ python3 -m virtualenv venv
$ source venv/bin/activate
Build the Python Wheel within a Python virtual environment.
$ python3 -m venv venv
$ source venv/bin/activate
(venv) $ git clone https://github.com/eclipse-zenoh/zenoh-flow-python
(venv) $ cd zenoh-flow-python/zenoh-flow-python
(venv) $ pip3 install -r requirements-dev.txt
(venv) $ maturin build --release
Deactivate the venv and install the python bindings.
(venv) deactivate
$ pip3 install ./target/wheels/<there should only be one .whl file here>
Build the Python wrappers.
$ cargo build --release -p zenoh-flow-python-operator-wrapper -p zenoh-flow-python-sink-wrapper -p zenoh-flow-python-source-wrapper
Once you have installed the Python binding you can also generate the documentation.
$ cd docs
$ pip3 install sphinx_rtd_theme sphinx -y
$ make html
The docs will be available under _build/html/index.html
.
In order to install the Python extension, please execute the following steps:
- Copy the result of the build into
/var/zenoh-flow/python/
:sudo cp ./target/release/libzenoh_flow_python* /var/zenoh-flow/python/
- Update the paths in
01-python.zfext
according to your operating system (i.e., replace.so
with.dylib
for MacOS). - Copy
01-python.zfext
into/etc/zenoh-flow/extensions.d
:sudo cp 01-python.zfext /etc/zenoh-flow/extensions.d/
Please refer to our getting started example: Zenoh-Flow Getting started.