From 1db26aab15c32c67ce52033f9cc9447b76875547 Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Sat, 15 Jun 2024 15:10:36 +1000 Subject: [PATCH] Fix #4837. Make mathutils dependency optional. In the long term, I'd like to replace mathutils with numpy. --- src/ifcopenshell-python/ifcopenshell/util/shape_builder.py | 2 +- src/ifcopenshell-python/pyproject.toml | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ifcopenshell-python/ifcopenshell/util/shape_builder.py b/src/ifcopenshell-python/ifcopenshell/util/shape_builder.py index fac2f12bf1..a99bea49f3 100644 --- a/src/ifcopenshell-python/ifcopenshell/util/shape_builder.py +++ b/src/ifcopenshell-python/ifcopenshell/util/shape_builder.py @@ -25,7 +25,7 @@ import ifcopenshell.api import ifcopenshell.util.element import ifcopenshell.util.representation import ifcopenshell.util.unit -from math import cos, sin, pi, tan, radians, degrees, atan, sqrt, ceil +from math import cos, sin, pi, tan, radians, degrees, atan, sqrt from typing import Union, Optional, Literal, Any, Sequence from itertools import chain from mathutils import Vector, Matrix diff --git a/src/ifcopenshell-python/pyproject.toml b/src/ifcopenshell-python/pyproject.toml index 8a6ebdd48b..154aa7f30f 100644 --- a/src/ifcopenshell-python/pyproject.toml +++ b/src/ifcopenshell-python/pyproject.toml @@ -15,7 +15,11 @@ classifiers = [ "Programming Language :: Python :: 3", "License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)", ] -dependencies = ["mathutils", "shapely", "numpy", "isodate", "python-dateutil", "lark"] +dependencies = ["shapely", "numpy", "isodate", "python-dateutil", "lark"] + +[project.optional-dependencies] +geometry = ["mathutils"] +dev = ["pytest"] [project.urls] "Homepage" = "http://ifcopenshell.org"