Skip to content

Commit

Permalink
feat: make chroma package optional (#38)
Browse files Browse the repository at this point in the history
Close #36
  • Loading branch information
tazarov authored Sep 10, 2024
1 parent 951ec4c commit 974c9fc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
8 changes: 8 additions & 0 deletions chromadbx/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
try:
import chromadb # noqa: F401
except ImportError:
raise ValueError(
"The chromadb is not installed. This package (chromadbx) requires that Chroma is installed to work. "
"Please install it with `pip install chromadb`"
)

from chromadbx.core.ids import (
IDGenerator,
NanoIDGenerator,
Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@ packages = [{ include = "chromadbx" }]
[tool.poetry.dependencies]
python = ">=3.9,<=4.0"
pydantic = "^2.7.2"
chromadb = ">=0.4.0,<=0.6.0"
chromadb = { version = ">=0.4.0,<=0.6.0", optional = true }
ulid-py = { version = "^1.1.0", optional = true }
nanoid = { version = "^2.0.0", optional = true }
llama-embedder = { version = "^0.0.7", optional = true }

[tool.poetry.group.dev.dependencies]
chromadb = { version = ">=0.4.0,<=0.6.0" }
pytest = "^8.2.1"
black = "24.3.0"
pre-commit = "^3.6.0"
Expand All @@ -33,7 +34,7 @@ llama-embedder = "^0.0.7"

[tool.poetry.extras]
ids = ["ulid-py", "nanoid"]
embeddings = ["llama-embedder","onnxruntime"]
embeddings = ["llama-embedder", "onnxruntime"]

[build-system]
requires = ["poetry-core"]
Expand Down

0 comments on commit 974c9fc

Please sign in to comment.