From 433207d3c5fc3d0f34c7e89cfc7f1d142764c2c3 Mon Sep 17 00:00:00 2001 From: pyr0ball Date: Sun, 12 Apr 2026 22:34:47 -0700 Subject: [PATCH] fix(community): move psycopg2 to optional community extra, lazy-import in __init__ --- circuitforge_core/__init__.py | 9 ++++++--- pyproject.toml | 4 +++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/circuitforge_core/__init__.py b/circuitforge_core/__init__.py index 03d2650..2b6c6b4 100644 --- a/circuitforge_core/__init__.py +++ b/circuitforge_core/__init__.py @@ -1,5 +1,8 @@ __version__ = "0.10.0" -from circuitforge_core.community import CommunityDB, CommunityPost, SharedStore - -__all__ = ["CommunityDB", "CommunityPost", "SharedStore"] +try: + from circuitforge_core.community import CommunityDB, CommunityPost, SharedStore + __all__ = ["CommunityDB", "CommunityPost", "SharedStore"] +except ImportError: + # psycopg2 not installed — install with: pip install circuitforge-core[community] + pass diff --git a/pyproject.toml b/pyproject.toml index 94771fb..6b2682d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,10 +11,12 @@ dependencies = [ "pyyaml>=6.0", "requests>=2.31", "openai>=1.0", - "psycopg2>=2.9", ] [project.optional-dependencies] +community = [ + "psycopg2>=2.9", +] manage = [ "platformdirs>=4.0", "typer[all]>=0.12",