From 247673ddb8850a06fe8a88811dc9a9090e9e74b7 Mon Sep 17 00:00:00 2001 From: Mason Daugherty Date: Mon, 30 Jun 2025 14:00:08 -0400 Subject: [PATCH] chroma: add ruff bandit rules (#31790) --- libs/partners/chroma/pyproject.toml | 8 +++++++- .../chroma/tests/integration_tests/test_vectorstores.py | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/libs/partners/chroma/pyproject.toml b/libs/partners/chroma/pyproject.toml index b1ed0477541..4537b4f1a6f 100644 --- a/libs/partners/chroma/pyproject.toml +++ b/libs/partners/chroma/pyproject.toml @@ -62,7 +62,7 @@ disallow_untyped_defs = true target-version = "py39" [tool.ruff.lint] -select = ["E", "F", "I", "T201", "D", "UP"] +select = ["E", "F", "I", "T201", "D", "UP", "S"] ignore = [ "UP007", ] [tool.coverage.run] @@ -81,3 +81,9 @@ convention = "google" [tool.ruff.lint.per-file-ignores] "tests/**" = ["D"] + +[tool.ruff.lint.extend-per-file-ignores] +"tests/**/*.py" = [ + "S101", # Tests need assertions + "S311", # Standard pseudo-random generators are not suitable for cryptographic purposes +] \ No newline at end of file diff --git a/libs/partners/chroma/tests/integration_tests/test_vectorstores.py b/libs/partners/chroma/tests/integration_tests/test_vectorstores.py index 08a776e2152..a42ba95254c 100644 --- a/libs/partners/chroma/tests/integration_tests/test_vectorstores.py +++ b/libs/partners/chroma/tests/integration_tests/test_vectorstores.py @@ -574,7 +574,7 @@ def test_chroma_add_documents_mixed_metadata() -> None: def is_api_accessible(url: str) -> bool: try: - response = requests.get(url) + response = requests.get(url, timeout=5) return response.status_code == 200 except Exception: return False