Package: cyclonedds-nightly
Python binding for Eclipse Cyclone DDSA Python binding forEclipse Cyclone DDS.Getting StartedEclipse CycloneDDS Python requires Python version 3.7 or higher. You can installwith included Cyclone DDS binariesor leveraging an existing Cyclone DDS installation byinstalling from sourcevia PyPi.Documentation can be found on thecyclonedds.iowebsite:Python API docsInstalling with pre-built Cyclone DDS binariesThis is the most straightforward method to install Cyclone DDS Python, but there are a couple of caveats. The pre-built package:has no support for DDS Security,has no support for shared memory via Iceoryx,comes with generic Cyclone DDS binaries that are not optimized per-platform.If these are of concern, proceed with aninstallation from source. If not, running this installation is as simple as:$pipinstallcycloneddsYou can also use the nightly build stream instead, which is built from themasterbranches ofcycloneddsandcyclonedds-python. This will always get you the latest and greatest, but less stable version that might contain API breaks.$pipinstallcyclonedds-nightlyInstalling from sourceWhen installing from source you can make use of the full list of features offered byCyclone DDS. First installCyclone DDSas normal. Make sure thatCyclone DDSis built with the ENABLE_TYPELIB option set toON(the default for this option). Then continue by setting theCYCLONEDDS_HOMEenvironment variable to the installation location ofCyclone DDS, which is the same as what was used forCMAKE_INSTALL_PREFIX. You will have to have this variable active any time you run Python code that depends oncycloneddsso adding it to.bashrcon Linux,~/bash_profileon MacOS or the System Variables in Windows can be helpful. This also allows you to switch, move or updateCyclone DDSwithout recompiling the Python package.You'll need the Python development headers to complete the install. If usingapt, trysudo apt install python3-dev. For other distributions, seethis comment.via PyPiYou can install the source from the latest release fromPypi, or use a tag to get a specific version. A full example (for linux) is shown below$gitclonehttps://github.com/eclipse-cyclonedds/cyclonedds
$cdcyclonedds&&mkdirbuildinstall&&cdbuild
$cmake..-DCMAKE_INSTALL_PREFIX=../install
$cmake--build.--targetinstall
$cd..
$exportCYCLONEDDS_HOME="$(pwd)/install"$pip3installcyclonedds--no-binarycycloneddsvia gitA full example installation of the quickest way to get started via git is shown below:$gitclonehttps://github.com/eclipse-cyclonedds/cyclonedds
$cdcyclonedds&&mkdirbuildinstall&&cdbuild
$cmake..-DCMAKE_INSTALL_PREFIX=../install
$cmake--build.--targetinstall
$cd..
$exportCYCLONEDDS_HOME="$(pwd)/install"$pip3installgit+https://github.com/eclipse-cyclonedds/cyclonedds-pythonCommand line toolingThe Python package contains a suite of command line tools, all nested under the main entrypointcyclonedds. The main help screen shows the commands available:cyclonedds lsThelssubcommand shows you the entities in your DDS system and their QoS settings. For example, here is the output when running theVehicleexample from this repo in the background:cyclonedds psThepssubcommand shows you the applications in your DDS system. Note that this depends on so called 'Participant Properties', tactfully named QoS properties in DDS participants. These were merged into CycloneDDS for version 0.10.0. Here is an example of the output when running theVehicleexample from this repo in the background on a single host:cyclonedds typeofThetypeofsubcommand shows you the type(s) of a topic in your system. With XTypes it can happen that more than one type for each topic exists and that they are still compatible. The types are represented in IDL. Here is an example of the output when running theVehicleexample:cyclonedds subscribeThesubscribesubcommand dynamically subscribes to a topic and shows you the data as it arrives. The type is discovered in a similar manner astypeof. Here is an example of the output when running theVehicleexample:cyclonedds publishThepublishsubcommand dynamically builds a REPL with datatypes and a writer for a topic and shows you the data as it arrives. The type is discovered in a similar manner astypeof.cyclonedds performanceTheperformancesubcommand is a nicer frontend toddsperfwith four modes:publish,subscribe,pingandpong. The below performance run example is thecyclonedds performance subscribemode rendered withcyclonedds performance publishrunning in the background.ContributingWe very much welcome all contributions to the project, whether that is questions, examples, bug
fixes, enhancements or improvements to the documentation, or anything else really.
When considering contributing code, it might be good to know that build configurations for Azure pipelines are present in the repository and that there is a test suite using pytest, along with flake8 code linting, and documentation built with sphinx. Be sure to install with theExtra dependenciesif you're going to run tests, lints or build the docs.You can run the test suite and linting using thelocal-ci.pyscript in this repo.$pythonlocal-ci.pyOr lint a single file/directory (as the whole repo can be a little noisey) using:$python-mflake8path/to/some_file.pyYou can build and serve the documentation (athttp://localhost:8000/) using:cddocs
python-msphinxsource/_build/# Serve the HTML files to view at localhost:8000python-mhttp.server-d_buildExtra dependenciesThecycloneddspackage defines two sets of optional dependencies,devanddocs, used for developingcycloneddsand building the documentation, respectively. If you want to install with development tools add the component to your installation, for example:$pip3install--user"cyclonedds[dev] @ git+https://github.com/eclipse-cyclonedds/cyclonedds-python"Or when installing from a local git clone, which is recommended when developing or building the docs:$cd/path/to/git/clone# for development:$pip3install--user".[dev]"# for documentation generation$pip3install--user".[docs]"# or for both$pip3install--user".[dev,docs]"For more information seethe packaging guide information on optional dependencies.PyOxidizer buildYou can build a self-contained binary of thecycloneddsCLI tool using PyOxidizer. It should be as simple as:$cd/path/to/git/clone
$pip3install--userpyoxidizer
$pyoxidizerbuild