ifcopenshell.validate - remove simple_spf dependency (689289b)

Moved it to `TYPE_CHECKING` since it's currently used just for typing.

Was breaking validation in Bonsai since it doesn't provide all submodules with IfcOpenShell https://github.com/IfcOpenShell/IfcOpenShell/issues/6723#issuecomment-3016223786

Also added a simple test so github workflow would catch a simple error like this.
This commit is contained in:
Andrej730
2025-06-30 18:08:24 +05:00
parent c23c21cb88
commit fc10915d2b
2 changed files with 11 additions and 2 deletions
@@ -42,6 +42,7 @@ options:
"""
from __future__ import annotations
import os
import sys
import json
@@ -50,7 +51,7 @@ import types
import argparse
from collections import namedtuple
from typing import Union, Any, Optional
from typing import Union, Any, Optional, TYPE_CHECKING
from collections.abc import Iterator
from logging import Logger, Handler
@@ -60,11 +61,13 @@ else:
EllipsisType = type(...)
import ifcopenshell
import ifcopenshell.simple_spf
import ifcopenshell.ifcopenshell_wrapper
import ifcopenshell.ifcopenshell_wrapper as W
import ifcopenshell.express.rule_executor
if TYPE_CHECKING:
import ifcopenshell.simple_spf
named_type = ifcopenshell.ifcopenshell_wrapper.named_type
aggregation_type = ifcopenshell.ifcopenshell_wrapper.aggregation_type
simple_type = ifcopenshell.ifcopenshell_wrapper.simple_type