Skip to content

Commit da56199

Browse files
committed
fix: make cyclonedds optional and add click dependency
Move cyclonedds to optional dependencies since the Python bindings require the native CycloneDDS C library which is not available in standard CI environments. All mock-based tests run without it. - cyclonedds moved to [project.optional-dependencies] so uv/pip won't attempt to build it unless explicitly requested - click added as direct dependency (was used but undeclared) - TestIdlTypeCollisions skipped when cyclonedds unavailable - Follows same pattern as gpiod driver (platform-conditional dep)
1 parent dfc6d01 commit da56199

3 files changed

Lines changed: 83 additions & 5 deletions

File tree

python/packages/jumpstarter-driver-dds/jumpstarter_driver_dds/regression_test.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,21 @@
1717
DdsSample,
1818
DdsTopicQos,
1919
)
20-
from .driver import Dds, MockDds, _make_idl_type, _validate_field_names
20+
from .driver import Dds, MockDds, _validate_field_names
2121
from jumpstarter.common.utils import serve
2222
from jumpstarter.driver.decorators import (
2323
MARKER_DRIVERCALL,
2424
MARKER_MAGIC,
2525
MARKER_STREAMING_DRIVERCALL,
2626
)
2727

28+
try:
29+
import cyclonedds as _cyclonedds # noqa: F401
30+
31+
_has_cyclonedds = True
32+
except ImportError:
33+
_has_cyclonedds = False
34+
2835
# =============================================================================
2936
# 1. Backend parity: identical operations must produce identical results
3037
# =============================================================================
@@ -193,21 +200,28 @@ def test_publish_result_has_no_success_field(self):
193200

194201

195202
# =============================================================================
196-
# 5. _make_idl_type name collision guard
203+
# 5. _make_idl_type name collision guard (requires cyclonedds native lib)
197204
# =============================================================================
198205

199206

207+
@pytest.mark.skipif(not _has_cyclonedds, reason="CycloneDDS native library not available")
200208
class TestIdlTypeCollisions:
201209
def test_similar_names_produce_distinct_types(self):
210+
from .driver import _make_idl_type
211+
202212
t1 = _make_idl_type("sensor/temp", ["v"])
203213
t2 = _make_idl_type("sensor-temp", ["v"])
204214
assert t1.__name__ != t2.__name__
205215

206216
def test_numeric_prefix_produces_valid_identifier(self):
217+
from .driver import _make_idl_type
218+
207219
t = _make_idl_type("123-topic", ["v"])
208220
assert t.__name__.isidentifier()
209221

210222
def test_slash_dot_dash_all_handled(self):
223+
from .driver import _make_idl_type
224+
211225
for name in ["a/b", "a.b", "a-b", "a/b.c-d"]:
212226
t = _make_idl_type(name, ["f"])
213227
assert t.__name__.isidentifier(), f"Invalid identifier for topic '{name}'"

python/packages/jumpstarter-driver-dds/pyproject.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,12 @@ authors = [
1010
requires-python = ">=3.11"
1111
dependencies = [
1212
"jumpstarter",
13-
"cyclonedds>=0.10.0,<1.0",
13+
"click>=8.1.7.2",
1414
]
1515

16+
[project.optional-dependencies]
17+
cyclonedds = ["cyclonedds>=0.10.0,<1.0"]
18+
1619
[project.entry-points."jumpstarter.drivers"]
1720
Dds = "jumpstarter_driver_dds.driver:Dds"
1821

python/uv.lock

Lines changed: 63 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)