Skip to content

Commit

Permalink
[exotica_python] Fail nicely when pip installed trimesh isnt available
Browse files Browse the repository at this point in the history
pip keys cannot be used for release on the buildfarm, hence we fail with
a warning when trimesh cannot be found. Also comments the key from
package.xml to make release builds possible.
  • Loading branch information
wxmerkt committed May 26, 2024
1 parent 7629f73 commit ba85d7c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
8 changes: 6 additions & 2 deletions exotica_python/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
<exec_depend condition="$ROS_PYTHON_VERSION == 3">python3-pyassimp</exec_depend>
<exec_depend condition="$ROS_PYTHON_VERSION == 3">python3-tk</exec_depend>
<exec_depend condition="$ROS_PYTHON_VERSION == 3">python3-rospkg</exec_depend>
<test_depend condition="$ROS_PYTHON_VERSION == 2">python-trimesh-pip</test_depend>
<test_depend condition="$ROS_PYTHON_VERSION == 3">python3-trimesh-pip</test_depend>
<!--
pip keys cannot be used for releases on the buildfarm cf.
https://github.com/ros/rosdistro/pull/39892#issuecomment-1985640859
-->
<!-- <test_depend condition="$ROS_PYTHON_VERSION == 2">python-trimesh-pip</test_depend>
<test_depend condition="$ROS_PYTHON_VERSION == 3">python3-trimesh-pip</test_depend> -->
</package>
7 changes: 6 additions & 1 deletion exotica_python/test/test_mesh.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import unittest

import pyexotica as exo
import trimesh
try:
import trimesh
except ImportError:
import warnings
warnings.warn("trimesh not found, skipping test")
exit()

def validate_mesh(mesh):
print(mesh, mesh.vertex_count, mesh.triangle_count)
Expand Down

0 comments on commit ba85d7c

Please sign in to comment.