Skip to content

Add Tests #377

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

Closed
wants to merge 11 commits into from
Closed
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
7 changes: 7 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[report]
exclude_lines =
pragma: no cover
def __repr__
if __name__ == "__main__":
@abstractmethod
pass
120 changes: 118 additions & 2 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

138 changes: 70 additions & 68 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,87 +1,89 @@
[project]
name = "graphiti-core"
description = "A temporal graph building library"
version = "0.10.3"
authors = [
{ "name" = "Paul Paliychuk", "email" = "paul@getzep.com" },
{ "name" = "Preston Rasmussen", "email" = "preston@getzep.com" },
{ "name" = "Daniel Chalef", "email" = "daniel@getzep.com" },
]
readme = "README.md"
license = "Apache-2.0"
requires-python = ">=3.10,<4"
packages = [{ include = "graphiti_core", from = "." }]
dependencies = [
"pydantic>=2.8.2",
"neo4j>=5.23.0",
"diskcache>=5.6.3",
"openai>=1.53.0",
"tenacity>=9.0.0",
"numpy>=1.0.0",
"python-dotenv>=1.0.1",
"graph-service (>=1.0.0.7,<2.0.0.0)",
]
authors = [
{ "name" = "Daniel Chalef", "email" = "daniel@getzep.com" },
{ "name" = "Paul Paliychuk", "email" = "paul@getzep.com" },
{ "name" = "Preston Rasmussen", "email" = "preston@getzep.com" },
]
dependencies = [
"diskcache>=5.6.3",
"graph-service (>=1.0.0.7,<2.0.0.0)",
"neo4j>=5.23.0",
"numpy>=1.0.0",
"openai>=1.53.0",
"pydantic>=2.8.2",
"python-dotenv>=1.0.1",
"tenacity>=9.0.0",
]
description = "A temporal graph building library"
license = "Apache-2.0"
name = "graphiti-core"
packages = [{ include = "graphiti_core", from = "." }]
readme = "README.md"
requires-python = ">=3.10,<4"
version = "0.10.3"

[project.urls]
Homepage = "https://help.getzep.com/graphiti/graphiti/overview"
Repository = "https://github.com/getzep/graphiti"
Homepage = "https://help.getzep.com/graphiti/graphiti/overview"
Repository = "https://github.com/getzep/graphiti"

[project.optional-dependencies]
anthropic = ["anthropic>=0.49.0"]
groq = ["groq>=0.2.0"]
google-genai = ["google-genai>=1.8.0"]
anthropic = ["anthropic>=0.49.0"]
google-genai = ["google-genai>=1.8.0"]
groq = ["groq>=0.2.0"]

[tool.poetry.group.dev.dependencies]
mypy = ">=1.11.1"
groq = ">=0.2.0"
anthropic = ">=0.49.0"
google-genai = ">=1.8.0"
ipykernel = ">=6.29.5"
jupyterlab = ">=4.2.4"
diskcache-stubs = ">=5.6.3.6.20240818"
langgraph = ">=0.2.15"
langchain-anthropic = ">=0.2.4"
langsmith = ">=0.1.108"
langchain-openai = ">=0.2.6"
sentence-transformers = ">=3.2.1"
transformers = ">=4.45.2"
voyageai = ">=0.2.3"
pytest = ">=8.3.3"
pytest-asyncio = ">=0.24.0"
pytest-xdist = ">=3.6.1"
ruff = ">=0.7.1"
anthropic = ">=0.49.0"
diskcache-stubs = ">=5.6.3.6.20240818"
google-genai = ">=1.8.0"
groq = ">=0.2.0"
ipykernel = ">=6.29.5"
jupyterlab = ">=4.2.4"
langchain-anthropic = ">=0.2.4"
langchain-openai = ">=0.2.6"
langgraph = ">=0.2.15"
langsmith = ">=0.1.108"
mypy = ">=1.11.1"
pytest = ">=8.3.3"
pytest-asyncio = ">=0.24.0"
pytest-xdist = ">=3.6.1"
ruff = ">=0.7.1"
sentence-transformers = ">=3.2.1"
transformers = ">=4.45.2"
voyageai = ">=0.2.3"
pytest-cov = "^6.1.1"
pytest-mock = "^3.14.0"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
build-backend = "poetry.core.masonry.api"
requires = ["poetry-core"]

[tool.poetry]
requires-poetry = ">=2.0"
requires-poetry = ">=2.0"

[tool.pytest.ini_options]
pythonpath = ["."]
pythonpath = ["."]

[tool.ruff]
line-length = 100
line-length = 100

[tool.ruff.lint]
select = [
# pycodestyle
"E",
# Pyflakes
"F",
# pyupgrade
"UP",
# flake8-bugbear
"B",
# flake8-simplify
"SIM",
# isort
"I",
]
ignore = ["E501"]
ignore = ["E501"]
select = [
# pycodestyle
"E",
# Pyflakes
"F",
# pyupgrade
"UP",
# flake8-bugbear
"B",
# flake8-simplify
"SIM",
# isort
"I",
]

[tool.ruff.format]
quote-style = "single"
indent-style = "space"
docstring-code-format = true
docstring-code-format = true
indent-style = "space"
quote-style = "single"
26 changes: 25 additions & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
[pytest]
# Test selection and discovery
markers =
integration: marks tests as integration tests
integration: marks tests as integration tests
testpaths = tests
python_files = test_*.py

# Async configuration
asyncio_mode = strict
asyncio_default_fixture_loop_scope = function

# Warning filters
filterwarnings =
ignore::UserWarning:neo4j._optional_deps.*:

# Coverage configuration
[coverage:report]
exclude_lines =
pragma: no cover
def __repr__
if __name__ == "__main__":
@abstractmethod
pass

# Tool-specific settings
[tool:pytest]
addopts = --cov=graphiti_core --cov-report=term-missing
28 changes: 28 additions & 0 deletions tests/embedder/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
"""
Copyright 2024, Zep Software, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""

import pytest

from graphiti_core.embedder.client import EMBEDDING_DIM


@pytest.fixture
def mock_embedding_values() -> list[float]:
"""Returns a list of mock embedding values with the default dimension.

This can be used across different embedder tests to create consistent mock responses.
"""
return [0.1] * EMBEDDING_DIM
Loading
Loading