-
Notifications
You must be signed in to change notification settings - Fork 838
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
Closed
Add Tests #377
Changes from 4 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
dd1c233
add pytest-cov and pytest-mock
evanmschultz 0a238b5
add coverage configuration
evanmschultz cbbd4cb
add embedder tests
evanmschultz 8c2f234
rename test files to prevent name collision errors for tests in other…
evanmschultz 680e736
improve env var handling
evanmschultz a21bcd5
improve test assertions and docs
evanmschultz 29d1a94
update test command comment
evanmschultz 098affd
update test command comment in tests/embedder/test_embedder_voyage.py
evanmschultz 02239c4
update .coveragerc
evanmschultz 6169b99
update pytest.ini
evanmschultz dcf12c0
update test command in tests/embedder/test_embedder_gemini.py
evanmschultz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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__ | ||
evanmschultz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
if __name__ == .__main__.: | ||
@abstractmethod | ||
pass | ||
|
||
# Tool-specific settings | ||
[tool:pytest] | ||
addopts = --cov=graphiti_core --cov-report=term-missing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.