From 52afc8ad105374f3b4750fb005db6ded274f9e81 Mon Sep 17 00:00:00 2001 From: Peter Sharpe Date: Mon, 4 Mar 2024 16:30:03 -0500 Subject: [PATCH] remove cadquery as mandatory dependency (due to downstream NLOPT dependency barring 3.12) and add guard on imports --- aerosandbox/geometry/airplane.py | 6 +++++- setup.py | 1 - 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/aerosandbox/geometry/airplane.py b/aerosandbox/geometry/airplane.py index 9f2f19de..25573d48 100644 --- a/aerosandbox/geometry/airplane.py +++ b/aerosandbox/geometry/airplane.py @@ -799,7 +799,11 @@ def generate_cadquery_geometry(self, Returns: A CADQuery Workplane object containing the CAD geometry of the airplane. """ - import cadquery as cq + try: + import cadquery as cq + except ModuleNotFoundError: + raise ModuleNotFoundError( + "The `cadquery` library is required to use this function. Please install it with `pip install cadquery`.") solids = [] diff --git a/setup.py b/setup.py index 28ccaf57..1dd82e1f 100644 --- a/setup.py +++ b/setup.py @@ -63,7 +63,6 @@ 'pyvista >= 0.31', 'trimesh >= 3', 'sympy >= 1', - 'cadquery >= 2', 'shapely >= 2', ], "test": [