This commit is contained in:
Andrea Pozzetti
2026-02-12 22:55:40 +01:00
parent 275c9cf96d
commit bc24e528d3
+12 -1
View File
@@ -28,6 +28,17 @@ if 'PYTEST_CURRENT_TEST' not in os.environ:
print("[GeomPack] CGAL and Blender operations will not be available")
print("[GeomPack] Run 'comfy-env install' to create the isolated environment")
# Setup import stubs BEFORE importing nodes
# This allows imports like 'import trimesh' to succeed even though
# trimesh is only installed in the isolated pixi environment
try:
from comfy_env import setup_isolated_imports
setup_isolated_imports(__file__)
except ImportError:
print("[GeomPack] comfy-env not installed, import stubbing disabled")
except Exception as e:
print(f"[GeomPack] Failed to setup import stubs: {e}")
from .nodes import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS
# Enable process isolation - all nodes run in pixi env (Python 3.11)
@@ -35,7 +46,7 @@ if 'PYTEST_CURRENT_TEST' not in os.environ:
from comfy_env import enable_isolation
enable_isolation(NODE_CLASS_MAPPINGS)
except ImportError:
print("[GeomPack] comfy-env not installed, isolation disabled")
pass # Already warned above
except Exception as e:
print(f"[GeomPack] Failed to enable isolation: {e}")