From 54a3730c2024e431b08998de73889ef484b63d24 Mon Sep 17 00:00:00 2001 From: Bruno Postle Date: Mon, 6 May 2024 13:55:20 +0100 Subject: [PATCH] fix d11ec67 mathutils dependency regression mathutils is a blender module, wrap imports in try/except --- .../ifcopenshell/api/geometry/__init__.py | 15 ++++++++++++--- .../ifcopenshell/api/grid/__init__.py | 5 ++++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/ifcopenshell-python/ifcopenshell/api/geometry/__init__.py b/src/ifcopenshell-python/ifcopenshell/api/geometry/__init__.py index 1caaa312ba..0aa8756ea0 100644 --- a/src/ifcopenshell-python/ifcopenshell/api/geometry/__init__.py +++ b/src/ifcopenshell-python/ifcopenshell/api/geometry/__init__.py @@ -18,11 +18,17 @@ from .add_axis_representation import add_axis_representation from .add_boolean import add_boolean -from .add_door_representation import add_door_representation +try: + from .add_door_representation import add_door_representation +except ModuleNotFoundError as e: + print(f"Note: API not available due to missing dependencies: geometry.add_door_representation - {e}") from .add_footprint_representation import add_footprint_representation from .add_mesh_representation import add_mesh_representation from .add_profile_representation import add_profile_representation -from .add_railing_representation import add_railing_representation +try: + from .add_railing_representation import add_railing_representation +except ModuleNotFoundError as e: + print(f"Note: API not available due to missing dependencies: geometry.add_railing_representation - {e}") try: from .add_representation import add_representation @@ -30,7 +36,10 @@ except ModuleNotFoundError as e: print(f"Note: API not available due to missing dependencies: geometry.add_representation - {e}") from .add_slab_representation import add_slab_representation from .add_wall_representation import add_wall_representation -from .add_window_representation import add_window_representation +try: + from .add_window_representation import add_window_representation +except ModuleNotFoundError as e: + print(f"Note: API not available due to missing dependencies: geometry.add_window_representation - {e}") from .assign_representation import assign_representation from .connect_element import connect_element from .connect_path import connect_path diff --git a/src/ifcopenshell-python/ifcopenshell/api/grid/__init__.py b/src/ifcopenshell-python/ifcopenshell/api/grid/__init__.py index c66e86a668..9991a7bc06 100644 --- a/src/ifcopenshell-python/ifcopenshell/api/grid/__init__.py +++ b/src/ifcopenshell-python/ifcopenshell/api/grid/__init__.py @@ -16,6 +16,9 @@ # You should have received a copy of the GNU Lesser General Public License # along with IfcOpenShell. If not, see . -from .create_axis_curve import create_axis_curve +try: + from .create_axis_curve import create_axis_curve +except ModuleNotFoundError as e: + print(f"Note: API not available due to missing dependencies: grid.create_axis_curve - {e}") from .create_grid_axis import create_grid_axis from .remove_grid_axis import remove_grid_axis