Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: make chroma package optional #38

Merged
merged 2 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading