From dfc2125ca2192bd81a573631d5913b11f192ff90 Mon Sep 17 00:00:00 2001 From: anakin87 Date: Wed, 25 Sep 2024 18:17:44 +0200 Subject: [PATCH 1/8] updates --- integrations/amazon_bedrock/pyproject.toml | 8 ++++---- integrations/amazon_sagemaker/pyproject.toml | 8 ++++---- integrations/anthropic/pyproject.toml | 8 ++++---- integrations/chroma/pyproject.toml | 8 ++++---- integrations/chroma/tests/test_document_store.py | 2 +- integrations/cohere/pyproject.toml | 8 ++++---- integrations/deepeval/pyproject.toml | 8 ++++---- integrations/elasticsearch/pyproject.toml | 8 ++++---- integrations/fastembed/pyproject.toml | 8 ++++---- integrations/google_ai/pyproject.toml | 8 ++++---- integrations/google_vertex/pyproject.toml | 8 ++++---- integrations/instructor_embedders/pyproject.toml | 8 ++++---- integrations/jina/pyproject.toml | 8 ++++---- integrations/langfuse/pyproject.toml | 2 +- integrations/llama_cpp/pyproject.toml | 8 ++++---- integrations/mistral/pyproject.toml | 8 ++++---- integrations/mongodb_atlas/pyproject.toml | 8 ++++---- integrations/nvidia/pyproject.toml | 8 ++++---- integrations/ollama/pyproject.toml | 8 ++++---- integrations/opensearch/pyproject.toml | 6 +++--- integrations/optimum/pyproject.toml | 2 +- integrations/pgvector/pyproject.toml | 8 ++++---- integrations/pinecone/pyproject.toml | 8 ++++---- integrations/qdrant/pyproject.toml | 6 +++--- integrations/ragas/pyproject.toml | 8 ++++---- integrations/snowflake/pyproject.toml | 8 ++++---- integrations/unstructured/pyproject.toml | 8 ++++---- integrations/weaviate/pyproject.toml | 2 +- 28 files changed, 98 insertions(+), 98 deletions(-) diff --git a/integrations/amazon_bedrock/pyproject.toml b/integrations/amazon_bedrock/pyproject.toml index f4a410dbd..df968c34f 100644 --- a/integrations/amazon_bedrock/pyproject.toml +++ b/integrations/amazon_bedrock/pyproject.toml @@ -67,7 +67,7 @@ typing = "mypy --install-types --non-interactive --explicit-package-bases {args: style = ["ruff check {args:.}", "black --check --diff {args:.}"] -fmt = ["black {args:.}", "ruff --fix {args:.}", "style"] +fmt = ["black {args:.}", "ruff check --fix {args:.}", "style"] all = ["style", "typing"] @@ -128,13 +128,13 @@ unfixable = [ "F401", ] -[tool.ruff.isort] +[tool.ruff.lint.isort] known-first-party = ["haystack_integrations"] -[tool.ruff.flake8-tidy-imports] +[tool.ruff.lint.flake8-tidy-imports] ban-relative-imports = "parents" -[tool.ruff.per-file-ignores] +[tool.ruff.lint.per-file-ignores] # Tests can use magic values, assertions, and relative imports "tests/**/*" = ["PLR2004", "S101", "TID252"] diff --git a/integrations/amazon_sagemaker/pyproject.toml b/integrations/amazon_sagemaker/pyproject.toml index f8050bb48..e0bc39eae 100644 --- a/integrations/amazon_sagemaker/pyproject.toml +++ b/integrations/amazon_sagemaker/pyproject.toml @@ -70,7 +70,7 @@ dependencies = ["black>=23.1.0", "mypy>=1.0.0", "ruff>=0.0.243"] [tool.hatch.envs.lint.scripts] typing = "mypy --install-types --non-interactive --explicit-package-bases {args:src/ tests}" style = ["ruff check {args:.}", "black --check --diff {args:.}"] -fmt = ["black {args:.}", "ruff --fix {args:.}", "style"] +fmt = ["black {args:.}", "ruff check --fix {args:.}", "style"] all = ["style", "typing"] [tool.black] @@ -131,13 +131,13 @@ unfixable = [ "F401", ] -[tool.ruff.isort] +[tool.ruff.lint.isort] known-first-party = ["haystack_integrations"] -[tool.ruff.flake8-tidy-imports] +[tool.ruff.lint.flake8-tidy-imports] ban-relative-imports = "parents" -[tool.ruff.per-file-ignores] +[tool.ruff.lint.per-file-ignores] # Tests can use magic values, assertions, and relative imports "tests/**/*" = ["PLR2004", "S101", "TID252"] diff --git a/integrations/anthropic/pyproject.toml b/integrations/anthropic/pyproject.toml index e1d3fa867..4a0a3ad3a 100644 --- a/integrations/anthropic/pyproject.toml +++ b/integrations/anthropic/pyproject.toml @@ -67,7 +67,7 @@ typing = "mypy --install-types --non-interactive --explicit-package-bases {args: style = ["ruff check {args:.}", "black --check --diff {args:.}"] -fmt = ["black {args:.}", "ruff --fix {args:.}", "style"] +fmt = ["black {args:.}", "ruff check --fix {args:.}", "style"] all = ["style", "typing"] @@ -129,13 +129,13 @@ unfixable = [ "F401", ] -[tool.ruff.isort] +[tool.ruff.lint.isort] known-first-party = ["haystack_integrations"] -[tool.ruff.flake8-tidy-imports] +[tool.ruff.lint.flake8-tidy-imports] ban-relative-imports = "parents" -[tool.ruff.per-file-ignores] +[tool.ruff.lint.per-file-ignores] # Tests can use magic values, assertions, and relative imports "tests/**/*" = ["PLR2004", "S101", "TID252"] diff --git a/integrations/chroma/pyproject.toml b/integrations/chroma/pyproject.toml index cebfa1b9d..fc462a62d 100644 --- a/integrations/chroma/pyproject.toml +++ b/integrations/chroma/pyproject.toml @@ -71,7 +71,7 @@ dependencies = [ [tool.hatch.envs.lint.scripts] typing = "mypy --install-types --non-interactive --explicit-package-bases {args:src/ tests}" style = ["ruff check {args:. --exclude tests/}", "black --check --diff {args:.}"] -fmt = ["black {args:.}", "ruff --fix {args:. --exclude tests/}", "style"] +fmt = ["black {args:.}", "ruff check --fix {args:. --exclude tests/}", "style"] all = ["style", "typing"] [tool.hatch.metadata] @@ -136,13 +136,13 @@ lint.unfixable = [ ] exclude = ["example"] -[tool.ruff.isort] +[tool.ruff.lint.isort] known-first-party = ["src", "example", "tests"] -[tool.ruff.flake8-tidy-imports] +[tool.ruff.lint.flake8-tidy-imports] ban-relative-imports = "parents" -[tool.ruff.per-file-ignores] +[tool.ruff.lint.per-file-ignores] # Tests can use magic values, assertions, and relative imports "tests/**/*" = ["PLR2004", "S101", "TID252"] "example/**/*" = ["T201"] diff --git a/integrations/chroma/tests/test_document_store.py b/integrations/chroma/tests/test_document_store.py index 3a6952ff8..d33086945 100644 --- a/integrations/chroma/tests/test_document_store.py +++ b/integrations/chroma/tests/test_document_store.py @@ -3,10 +3,10 @@ # SPDX-License-Identifier: Apache-2.0 import logging import operator +import sys import uuid from typing import List from unittest import mock -import sys import numpy as np import pytest diff --git a/integrations/cohere/pyproject.toml b/integrations/cohere/pyproject.toml index add8dc150..0f17cb281 100644 --- a/integrations/cohere/pyproject.toml +++ b/integrations/cohere/pyproject.toml @@ -68,7 +68,7 @@ style = [ "ruff check {args:. --exclude tests/}", "black --check --diff {args:.}", ] -fmt = ["black {args:.}", "ruff --fix {args:. --exclude tests/}", "style"] +fmt = ["black {args:.}", "ruff check --fix {args:. --exclude tests/}", "style"] all = ["style", "typing"] [tool.black] @@ -127,13 +127,13 @@ unfixable = [ "F401", ] -[tool.ruff.isort] +[tool.ruff.lint.isort] known-first-party = ["src"] -[tool.ruff.flake8-tidy-imports] +[tool.ruff.lint.flake8-tidy-imports] ban-relative-imports = "parents" -[tool.ruff.per-file-ignores] +[tool.ruff.lint.per-file-ignores] # Tests can use magic values, assertions, and relative imports "tests/**/*" = ["PLR2004", "S101", "TID252"] diff --git a/integrations/deepeval/pyproject.toml b/integrations/deepeval/pyproject.toml index 44d89cb11..9feb4f653 100644 --- a/integrations/deepeval/pyproject.toml +++ b/integrations/deepeval/pyproject.toml @@ -60,7 +60,7 @@ dependencies = ["black>=23.1.0", "mypy>=1.0.0", "ruff>=0.0.243"] [tool.hatch.envs.lint.scripts] typing = "mypy --install-types --non-interactive {args:src/}" style = ["ruff check {args:.}", "black --check --diff {args:.}"] -fmt = ["black {args:.}", "ruff --fix {args:.}", "style"] +fmt = ["black {args:.}", "ruff check --fix {args:.}", "style"] all = ["style", "typing"] [tool.black] @@ -123,13 +123,13 @@ unfixable = [ ] extend-exclude = ["tests", "example"] -[tool.ruff.isort] +[tool.ruff.lint.isort] known-first-party = ["src"] -[tool.ruff.flake8-tidy-imports] +[tool.ruff.lint.flake8-tidy-imports] ban-relative-imports = "all" -[tool.ruff.per-file-ignores] +[tool.ruff.lint.per-file-ignores] # Tests can use magic values, assertions, and relative imports "tests/**/*" = ["PLR2004", "S101", "TID252"] diff --git a/integrations/elasticsearch/pyproject.toml b/integrations/elasticsearch/pyproject.toml index 4e13b1c23..bb70d5bb9 100644 --- a/integrations/elasticsearch/pyproject.toml +++ b/integrations/elasticsearch/pyproject.toml @@ -66,7 +66,7 @@ dependencies = ["black>=23.1.0", "mypy>=1.0.0", "ruff>=0.0.243"] [tool.hatch.envs.lint.scripts] typing = "mypy --install-types --non-interactive --explicit-package-bases {args:src/ tests}" style = ["ruff check {args:. --exclude tests/}", "black --check --diff {args:.}"] -fmt = ["black {args:.}", "ruff --fix {args:. --exclude tests/}", "style"] +fmt = ["black {args:.}", "ruff check --fix {args:. --exclude tests/}", "style"] all = ["style", "typing"] [tool.hatch.metadata] @@ -128,13 +128,13 @@ unfixable = [ "F401", ] -[tool.ruff.isort] +[tool.ruff.lint.isort] known-first-party = ["src"] -[tool.ruff.flake8-tidy-imports] +[tool.ruff.lint.flake8-tidy-imports] ban-relative-imports = "parents" -[tool.ruff.per-file-ignores] +[tool.ruff.lint.per-file-ignores] # Tests can use magic values, assertions, and relative imports "tests/**/*" = ["PLR2004", "S101", "TID252"] diff --git a/integrations/fastembed/pyproject.toml b/integrations/fastembed/pyproject.toml index 4ebd765dd..e3868507f 100644 --- a/integrations/fastembed/pyproject.toml +++ b/integrations/fastembed/pyproject.toml @@ -67,7 +67,7 @@ dependencies = ["black>=23.1.0", "mypy>=1.0.0", "ruff>=0.0.243", "numpy"] [tool.hatch.envs.lint.scripts] typing = "mypy --install-types --non-interactive --explicit-package-bases {args:src/ tests}" style = ["ruff check {args:. --exclude tests/, examples/}", "black --check --diff {args:.}"] -fmt = ["black {args:.}", "ruff --fix {args:. --exclude tests/, examples/}", "style"] +fmt = ["black {args:.}", "ruff check --fix {args:. --exclude tests/, examples/}", "style"] all = ["style", "typing"] [tool.black] @@ -128,13 +128,13 @@ unfixable = [ "F401", ] -[tool.ruff.isort] +[tool.ruff.lint.isort] known-first-party = ["src"] -[tool.ruff.flake8-tidy-imports] +[tool.ruff.lint.flake8-tidy-imports] ban-relative-imports = "parents" -[tool.ruff.per-file-ignores] +[tool.ruff.lint.per-file-ignores] # Tests can use magic values, assertions, and relative imports "tests/**/*" = ["PLR2004", "S101", "TID252"] # examples can contain "print" commands diff --git a/integrations/google_ai/pyproject.toml b/integrations/google_ai/pyproject.toml index db958a487..f14ba4a34 100644 --- a/integrations/google_ai/pyproject.toml +++ b/integrations/google_ai/pyproject.toml @@ -64,7 +64,7 @@ dependencies = ["black>=23.1.0", "mypy>=1.0.0", "ruff>=0.0.243"] [tool.hatch.envs.lint.scripts] typing = "mypy --install-types --non-interactive --explicit-package-bases {args:src/ tests}" style = ["ruff check {args:.}", "black --check --diff {args:.}"] -fmt = ["black {args:.}", "ruff --fix {args:.}", "style"] +fmt = ["black {args:.}", "ruff check --fix {args:.}", "style"] all = ["style", "typing"] [tool.black] @@ -123,13 +123,13 @@ unfixable = [ "F401", ] -[tool.ruff.isort] +[tool.ruff.lint.isort] known-first-party = ["haystack_integrations"] -[tool.ruff.flake8-tidy-imports] +[tool.ruff.lint.flake8-tidy-imports] ban-relative-imports = "parents" -[tool.ruff.per-file-ignores] +[tool.ruff.lint.per-file-ignores] # Tests can use magic values, assertions, and relative imports "tests/**/*" = ["PLR2004", "S101", "TID252"] diff --git a/integrations/google_vertex/pyproject.toml b/integrations/google_vertex/pyproject.toml index 747bbecbf..ff45c97e7 100644 --- a/integrations/google_vertex/pyproject.toml +++ b/integrations/google_vertex/pyproject.toml @@ -64,7 +64,7 @@ dependencies = ["black>=23.1.0", "mypy>=1.0.0", "ruff>=0.0.243"] [tool.hatch.envs.lint.scripts] typing = "mypy --install-types --non-interactive --explicit-package-bases {args:src/ tests}" style = ["ruff check {args:.}", "black --check --diff {args:.}"] -fmt = ["black {args:.}", "ruff --fix {args:.}", "style"] +fmt = ["black {args:.}", "ruff check --fix {args:.}", "style"] all = ["style", "typing"] [tool.black] @@ -120,13 +120,13 @@ unfixable = [ "F401", ] -[tool.ruff.isort] +[tool.ruff.lint.isort] known-first-party = ["haystack_integrations"] -[tool.ruff.flake8-tidy-imports] +[tool.ruff.lint.flake8-tidy-imports] ban-relative-imports = "parents" -[tool.ruff.per-file-ignores] +[tool.ruff.lint.per-file-ignores] # Tests can use magic values, assertions, and relative imports "tests/**/*" = ["PLR2004", "S101", "TID252"] diff --git a/integrations/instructor_embedders/pyproject.toml b/integrations/instructor_embedders/pyproject.toml index 017062a47..4ace07ffc 100644 --- a/integrations/instructor_embedders/pyproject.toml +++ b/integrations/instructor_embedders/pyproject.toml @@ -89,7 +89,7 @@ dependencies = ["black>=23.1.0", "mypy>=1.0.0", "ruff>=0.0.243"] [tool.hatch.envs.lint.scripts] typing = "mypy --install-types --non-interactive --explicit-package-bases {args:src/ tests}" style = ["ruff check {args:. --exclude tests/}", "black --check --diff {args:.}"] -fmt = ["black {args:.}", "ruff --fix {args:. --exclude tests/}", "style"] +fmt = ["black {args:.}", "ruff check --fix {args:. --exclude tests/}", "style"] all = ["style", "typing"] [tool.coverage.run] @@ -152,13 +152,13 @@ unfixable = [ "F401", ] -[tool.ruff.isort] +[tool.ruff.lint.isort] known-first-party = ["instructor_embedders"] -[tool.ruff.flake8-tidy-imports] +[tool.ruff.lint.flake8-tidy-imports] ban-relative-imports = "parents" -[tool.ruff.per-file-ignores] +[tool.ruff.lint.per-file-ignores] # Tests can use magic values, assertions, and relative imports "tests/**/*" = ["PLR2004", "S101", "TID252"] diff --git a/integrations/jina/pyproject.toml b/integrations/jina/pyproject.toml index 908633686..74ce63a3c 100644 --- a/integrations/jina/pyproject.toml +++ b/integrations/jina/pyproject.toml @@ -63,7 +63,7 @@ dependencies = ["black>=23.1.0", "mypy>=1.0.0", "ruff>=0.0.243"] [tool.hatch.envs.lint.scripts] typing = "mypy --install-types --non-interactive --explicit-package-bases {args:src/ tests}" style = ["ruff check {args:. --exclude tests/}", "black --check --diff {args:.}"] -fmt = ["black {args:.}", "ruff --fix {args:. --exclude tests/}", "style"] +fmt = ["black {args:.}", "ruff check --fix {args:. --exclude tests/}", "style"] all = ["style", "typing"] [tool.black] @@ -119,13 +119,13 @@ unfixable = [ "F401", ] -[tool.ruff.isort] +[tool.ruff.lint.isort] known-first-party = ["jina_haystack"] -[tool.ruff.flake8-tidy-imports] +[tool.ruff.lint.flake8-tidy-imports] ban-relative-imports = "parents" -[tool.ruff.per-file-ignores] +[tool.ruff.lint.per-file-ignores] # Tests can use magic values, assertions, and relative imports "tests/**/*" = ["PLR2004", "S101", "TID252"] diff --git a/integrations/langfuse/pyproject.toml b/integrations/langfuse/pyproject.toml index 6f9213be7..04d85f740 100644 --- a/integrations/langfuse/pyproject.toml +++ b/integrations/langfuse/pyproject.toml @@ -70,7 +70,7 @@ dependencies = ["black>=23.1.0", "mypy>=1.0.0", "ruff>=0.0.243"] [tool.hatch.envs.lint.scripts] typing = "mypy --install-types --non-interactive --explicit-package-bases {args:src/ tests}" style = ["ruff check {args:. --exclude tests/}", "black --check --diff {args:.}"] -fmt = ["black {args:.}", "ruff --fix {args:. --exclude tests/}", "style"] +fmt = ["black {args:.}", "ruff check --fix {args:. --exclude tests/}", "style"] all = ["style", "typing"] [tool.hatch.metadata] diff --git a/integrations/llama_cpp/pyproject.toml b/integrations/llama_cpp/pyproject.toml index d57bd9fc9..b7498db5e 100644 --- a/integrations/llama_cpp/pyproject.toml +++ b/integrations/llama_cpp/pyproject.toml @@ -71,13 +71,13 @@ dependencies = ["black>=23.1.0", "mypy>=1.0.0", "ruff>=0.0.243"] [tool.hatch.envs.lint.scripts] typing = "mypy --install-types --non-interactive --explicit-package-bases {args:src/ tests}" style = ["ruff check {args:. --exclude tests/, examples/}", "black --check --diff {args:.}"] -fmt = ["black {args:.}", "ruff --fix {args:. --exclude tests/, examples/}", "style"] +fmt = ["black {args:.}", "ruff check --fix {args:. --exclude tests/, examples/}", "style"] all = ["style", "typing"] [tool.hatch.metadata] allow-direct-references = true -[tool.ruff.isort] +[tool.ruff.lint.isort] known-first-party = ["src"] [tool.black] @@ -133,10 +133,10 @@ unfixable = [ "F401", ] -[tool.ruff.flake8-tidy-imports] +[tool.ruff.lint.flake8-tidy-imports] ban-relative-imports = "parents" -[tool.ruff.per-file-ignores] +[tool.ruff.lint.per-file-ignores] # Tests can use magic values, assertions, and relative imports "tests/**/*" = ["PLR2004", "S101", "TID252"] # Examples can print their output diff --git a/integrations/mistral/pyproject.toml b/integrations/mistral/pyproject.toml index 8e28c2c06..32817d271 100644 --- a/integrations/mistral/pyproject.toml +++ b/integrations/mistral/pyproject.toml @@ -68,7 +68,7 @@ style = [ "ruff check {args:. --exclude tests/}", "black --check --diff {args:.}", ] -fmt = ["black {args:.}", "ruff --fix {args:. --exclude tests/}", "style"] +fmt = ["black {args:.}", "ruff check --fix {args:. --exclude tests/}", "style"] all = ["style", "typing"] [tool.black] @@ -127,13 +127,13 @@ unfixable = [ "F401", ] -[tool.ruff.isort] +[tool.ruff.lint.isort] known-first-party = ["src"] -[tool.ruff.flake8-tidy-imports] +[tool.ruff.lint.flake8-tidy-imports] ban-relative-imports = "parents" -[tool.ruff.per-file-ignores] +[tool.ruff.lint.per-file-ignores] # Tests can use magic values, assertions, and relative imports "tests/**/*" = ["PLR2004", "S101", "TID252"] diff --git a/integrations/mongodb_atlas/pyproject.toml b/integrations/mongodb_atlas/pyproject.toml index f8fcf4254..2f1cfe507 100644 --- a/integrations/mongodb_atlas/pyproject.toml +++ b/integrations/mongodb_atlas/pyproject.toml @@ -67,7 +67,7 @@ dependencies = ["black>=23.1.0", "mypy>=1.0.0", "ruff>=0.0.243"] [tool.hatch.envs.lint.scripts] typing = "mypy --install-types --non-interactive --explicit-package-bases {args:src/ tests}" style = ["ruff check {args:. --exclude tests/, examples/}", "black --check --diff {args:.}"] -fmt = ["black {args:.}", "ruff --fix {args:. --exclude tests/, examples/}", "style"] +fmt = ["black {args:.}", "ruff check --fix {args:. --exclude tests/, examples/}", "style"] all = ["style", "typing"] [tool.black] @@ -126,13 +126,13 @@ unfixable = [ "F401", ] -[tool.ruff.isort] +[tool.ruff.lint.isort] known-first-party = ["src"] -[tool.ruff.flake8-tidy-imports] +[tool.ruff.lint.flake8-tidy-imports] ban-relative-imports = "parents" -[tool.ruff.per-file-ignores] +[tool.ruff.lint.per-file-ignores] # Tests can use magic values, assertions, and relative imports "tests/**/*" = ["PLR2004", "S101", "TID252"] # examples can contain "print" commands diff --git a/integrations/nvidia/pyproject.toml b/integrations/nvidia/pyproject.toml index 82fb32b95..05aa642d8 100644 --- a/integrations/nvidia/pyproject.toml +++ b/integrations/nvidia/pyproject.toml @@ -70,7 +70,7 @@ style = [ "ruff check {args:. --exclude tests/}", "black --check --diff {args:.}", ] -fmt = ["black {args:.}", "ruff --fix {args:. --exclude tests/}", "style"] +fmt = ["black {args:.}", "ruff check --fix {args:. --exclude tests/}", "style"] all = ["style", "typing"] [tool.black] @@ -129,13 +129,13 @@ unfixable = [ "F401", ] -[tool.ruff.isort] +[tool.ruff.lint.isort] known-first-party = ["src"] -[tool.ruff.flake8-tidy-imports] +[tool.ruff.lint.flake8-tidy-imports] ban-relative-imports = "parents" -[tool.ruff.per-file-ignores] +[tool.ruff.lint.per-file-ignores] # Tests can use magic values, assertions, and relative imports "tests/**/*" = ["PLR2004", "S101", "TID252"] diff --git a/integrations/ollama/pyproject.toml b/integrations/ollama/pyproject.toml index 1174d3b78..37465dd8d 100644 --- a/integrations/ollama/pyproject.toml +++ b/integrations/ollama/pyproject.toml @@ -72,13 +72,13 @@ dependencies = ["black>=23.1.0", "mypy>=1.0.0", "ruff>=0.0.243"] [tool.hatch.envs.lint.scripts] typing = "mypy --install-types --non-interactive --explicit-package-bases {args:src/ tests}" style = ["ruff check {args:. --exclude tests/, examples/ }", "black --check --diff {args:.}"] -fmt = ["black {args:.}", "ruff --fix {args:. --exclude tests/, examples/ }", "style"] +fmt = ["black {args:.}", "ruff check --fix {args:. --exclude tests/, examples/ }", "style"] all = ["style", "typing"] [tool.hatch.metadata] allow-direct-references = true -[tool.ruff.isort] +[tool.ruff.lint.isort] known-first-party = ["src"] [tool.black] @@ -134,10 +134,10 @@ unfixable = [ "F401", ] -[tool.ruff.flake8-tidy-imports] +[tool.ruff.lint.flake8-tidy-imports] ban-relative-imports = "parents" -[tool.ruff.per-file-ignores] +[tool.ruff.lint.per-file-ignores] # Tests can use magic values, assertions, and relative imports "tests/**/*" = ["PLR2004", "S101", "TID252"] # Examples can print their output diff --git a/integrations/opensearch/pyproject.toml b/integrations/opensearch/pyproject.toml index 6be86727e..f707cd15a 100644 --- a/integrations/opensearch/pyproject.toml +++ b/integrations/opensearch/pyproject.toml @@ -130,13 +130,13 @@ unfixable = [ "F401", ] -[tool.ruff.isort] +[tool.ruff.lint.isort] known-first-party = ["src"] -[tool.ruff.flake8-tidy-imports] +[tool.ruff.lint.flake8-tidy-imports] ban-relative-imports = "parents" -[tool.ruff.per-file-ignores] +[tool.ruff.lint.per-file-ignores] # Tests can use magic values, assertions, and relative imports "tests/**/*" = ["PLR2004", "S101", "TID252"] diff --git a/integrations/optimum/pyproject.toml b/integrations/optimum/pyproject.toml index 2e0fb26a4..fe028204d 100644 --- a/integrations/optimum/pyproject.toml +++ b/integrations/optimum/pyproject.toml @@ -82,7 +82,7 @@ dependencies = ["black>=23.1.0", "mypy>=1.0.0", "ruff>=0.0.243"] [tool.hatch.envs.lint.scripts] typing = "mypy --install-types --non-interactive --explicit-package-bases {args:src/ tests}" style = ["ruff check {args:.}", "black --check --diff {args:.}"] -fmt = ["black {args:.}", "ruff --fix {args:.}", "style"] +fmt = ["black {args:.}", "ruff check --fix {args:.}", "style"] all = ["style", "typing"] [tool.hatch.metadata] diff --git a/integrations/pgvector/pyproject.toml b/integrations/pgvector/pyproject.toml index 8f4c2447b..a2234f936 100644 --- a/integrations/pgvector/pyproject.toml +++ b/integrations/pgvector/pyproject.toml @@ -67,7 +67,7 @@ dependencies = ["black>=23.1.0", "mypy>=1.0.0", "ruff>=0.0.243"] [tool.hatch.envs.lint.scripts] typing = "mypy --install-types --non-interactive --explicit-package-bases {args:src/ tests}" style = ["ruff check {args:. --exclude tests/, examples/}", "black --check --diff {args:.}"] -fmt = ["black {args:.}", "ruff --fix {args:. --exclude tests/, examples/}", "style"] +fmt = ["black {args:.}", "ruff check --fix {args:. --exclude tests/, examples/}", "style"] all = ["style", "typing"] [tool.black] @@ -128,13 +128,13 @@ unfixable = [ "F401", ] -[tool.ruff.isort] +[tool.ruff.lint.isort] known-first-party = ["src"] -[tool.ruff.flake8-tidy-imports] +[tool.ruff.lint.flake8-tidy-imports] ban-relative-imports = "parents" -[tool.ruff.per-file-ignores] +[tool.ruff.lint.per-file-ignores] # Tests can use magic values, assertions, and relative imports "tests/**/*" = ["PLR2004", "S101", "TID252"] # examples can contain "print" commands diff --git a/integrations/pinecone/pyproject.toml b/integrations/pinecone/pyproject.toml index 866385dd3..7895cfb83 100644 --- a/integrations/pinecone/pyproject.toml +++ b/integrations/pinecone/pyproject.toml @@ -71,7 +71,7 @@ dependencies = ["black>=23.1.0", "mypy>=1.0.0", "ruff>=0.0.243", "numpy"] [tool.hatch.envs.lint.scripts] typing = "mypy --install-types --non-interactive --explicit-package-bases {args:src/ tests}" style = ["ruff check {args:.}", "black --check --diff {args:.}"] -fmt = ["black {args:.}", "ruff --fix {args:.}", "style"] +fmt = ["black {args:.}", "ruff check --fix {args:.}", "style"] all = ["style", "typing"] [tool.hatch.metadata] @@ -133,13 +133,13 @@ unfixable = [ "F401", ] -[tool.ruff.isort] +[tool.ruff.lint.isort] known-first-party = ["haystack_integrations"] -[tool.ruff.flake8-tidy-imports] +[tool.ruff.lint.flake8-tidy-imports] ban-relative-imports = "parents" -[tool.ruff.per-file-ignores] +[tool.ruff.lint.per-file-ignores] # Tests can use magic values, assertions, and relative imports "tests/**/*" = ["PLR2004", "S101", "TID252"] # examples can contain "print" commands diff --git a/integrations/qdrant/pyproject.toml b/integrations/qdrant/pyproject.toml index 225844f22..1bfba3cac 100644 --- a/integrations/qdrant/pyproject.toml +++ b/integrations/qdrant/pyproject.toml @@ -63,7 +63,7 @@ dependencies = ["black>=23.1.0", "mypy>=1.0.0", "ruff>=0.0.243"] [tool.hatch.envs.lint.scripts] typing = "mypy --install-types --non-interactive --explicit-package-bases {args:src/ tests}" style = ["ruff check {args:. --exclude tests/, examples/}", "black --check --diff {args:.}"] -fmt = ["black {args:.}", "ruff --fix {args:. --exclude tests/, examples/}", "style"] +fmt = ["black {args:.}", "ruff check --fix {args:. --exclude tests/, examples/}", "style"] all = ["style", "typing"] [tool.black] @@ -125,10 +125,10 @@ unfixable = [ "F401", ] -[tool.ruff.flake8-tidy-imports] +[tool.ruff.lint.flake8-tidy-imports] ban-relative-imports = "parents" -[tool.ruff.per-file-ignores] +[tool.ruff.lint.per-file-ignores] # Tests can use magic values, assertions, and relative imports "tests/**/*" = ["PLR2004", "S101", "TID252"] # examples can contain "print" commands diff --git a/integrations/ragas/pyproject.toml b/integrations/ragas/pyproject.toml index d9ae6ca02..898e1ad10 100644 --- a/integrations/ragas/pyproject.toml +++ b/integrations/ragas/pyproject.toml @@ -66,7 +66,7 @@ dependencies = ["black>=23.1.0", "mypy>=1.0.0", "ruff>=0.0.243"] [tool.hatch.envs.lint.scripts] typing = "mypy --install-types --non-interactive {args:src/}" style = ["ruff check {args:.}", "black --check --diff {args:.}"] -fmt = ["black {args:.}", "ruff --fix {args:.}", "style"] +fmt = ["black {args:.}", "ruff check --fix {args:.}", "style"] all = ["style", "typing"] [tool.black] @@ -130,13 +130,13 @@ unfixable = [ ] extend-exclude = ["tests", "example"] -[tool.ruff.isort] +[tool.ruff.lint.isort] known-first-party = ["src"] -[tool.ruff.flake8-tidy-imports] +[tool.ruff.lint.flake8-tidy-imports] ban-relative-imports = "all" -[tool.ruff.per-file-ignores] +[tool.ruff.lint.per-file-ignores] # Tests can use magic values, assertions, and relative imports "tests/**/*" = ["PLR2004", "S101", "TID252"] diff --git a/integrations/snowflake/pyproject.toml b/integrations/snowflake/pyproject.toml index 68f9ec477..388c87158 100644 --- a/integrations/snowflake/pyproject.toml +++ b/integrations/snowflake/pyproject.toml @@ -63,7 +63,7 @@ dependencies = ["black>=23.1.0", "mypy>=1.0.0", "ruff>=0.0.243"] [tool.hatch.envs.lint.scripts] typing = "mypy --install-types --non-interactive --explicit-package-bases {args:src/ tests}" style = ["ruff check {args:. --exclude tests/}", "black --check --diff {args:.}"] -fmt = ["black {args:.}", "ruff --fix {args:. --exclude tests/}", "style"] +fmt = ["black {args:.}", "ruff check --fix {args:. --exclude tests/}", "style"] all = ["style", "typing"] [tool.black] @@ -123,13 +123,13 @@ unfixable = [ "F401", ] -[tool.ruff.isort] +[tool.ruff.lint.isort] known-first-party = ["snowflake_haystack"] -[tool.ruff.flake8-tidy-imports] +[tool.ruff.lint.flake8-tidy-imports] ban-relative-imports = "parents" -[tool.ruff.per-file-ignores] +[tool.ruff.lint.per-file-ignores] # Tests can use magic values, assertions, and relative imports "tests/**/*" = ["PLR2004", "S101", "TID252"] diff --git a/integrations/unstructured/pyproject.toml b/integrations/unstructured/pyproject.toml index 6811753d9..fd668db44 100644 --- a/integrations/unstructured/pyproject.toml +++ b/integrations/unstructured/pyproject.toml @@ -68,7 +68,7 @@ style = [ "ruff check {args:. --exclude tests/}", "black --check --diff {args:.}", ] -fmt = ["black {args:.}", "ruff --fix {args:. --exclude tests/}", "style"] +fmt = ["black {args:.}", "ruff check --fix {args:. --exclude tests/}", "style"] all = ["style", "typing"] [tool.hatch.metadata] @@ -130,13 +130,13 @@ unfixable = [ "F401", ] -[tool.ruff.isort] +[tool.ruff.lint.isort] known-first-party = ["src"] -[tool.ruff.flake8-tidy-imports] +[tool.ruff.lint.flake8-tidy-imports] ban-relative-imports = "parents" -[tool.ruff.per-file-ignores] +[tool.ruff.lint.per-file-ignores] # Tests can use magic values, assertions, and relative imports "tests/**/*" = ["PLR2004", "S101", "TID252"] diff --git a/integrations/weaviate/pyproject.toml b/integrations/weaviate/pyproject.toml index 624a06f1d..9598abd94 100644 --- a/integrations/weaviate/pyproject.toml +++ b/integrations/weaviate/pyproject.toml @@ -66,7 +66,7 @@ dependencies = ["black>=23.1.0", "mypy>=1.0.0", "ruff>=0.0.243"] [tool.hatch.envs.lint.scripts] typing = "mypy --install-types --non-interactive --explicit-package-bases {args:src/ tests}" style = ["ruff check {args:. --exclude tests/}", "black --check --diff {args:.}"] -fmt = ["black {args:.}", "ruff --fix {args:. --exclude tests/}", "style"] +fmt = ["black {args:.}", "ruff check --fix {args:. --exclude tests/}", "style"] all = ["style", "typing"] [tool.black] From 1f8fb44195d9278735763f88646b47e492fd2dba Mon Sep 17 00:00:00 2001 From: anakin87 Date: Wed, 25 Sep 2024 18:37:42 +0200 Subject: [PATCH 2/8] more changes --- integrations/amazon_bedrock/pyproject.toml | 2 ++ integrations/amazon_sagemaker/pyproject.toml | 2 ++ integrations/anthropic/pyproject.toml | 2 ++ integrations/astra/pyproject.toml | 10 ++++++---- integrations/chroma/pyproject.toml | 8 +++++--- integrations/cohere/examples/cohere_embedding.py | 1 - integrations/cohere/examples/cohere_generation.py | 1 - integrations/cohere/examples/cohere_ranker.py | 1 - integrations/cohere/pyproject.toml | 2 ++ .../components/embedders/cohere/document_embedder.py | 2 +- .../components/embedders/cohere/text_embedder.py | 2 +- .../cohere/tests/test_cohere_chat_generator.py | 1 + integrations/cohere/tests/test_cohere_generator.py | 1 + integrations/cohere/tests/test_cohere_ranker.py | 1 + integrations/cohere/tests/test_document_embedder.py | 1 + integrations/cohere/tests/test_text_embedder.py | 1 + integrations/deepeval/pyproject.toml | 4 +++- integrations/elasticsearch/pyproject.toml | 2 ++ .../retrievers/elasticsearch/bm25_retriever.py | 1 - .../retrievers/elasticsearch/embedding_retriever.py | 1 - integrations/fastembed/examples/example.py | 1 - integrations/fastembed/examples/sparse_example.py | 1 - integrations/fastembed/pyproject.toml | 2 ++ integrations/google_ai/pyproject.toml | 2 ++ integrations/google_vertex/pyproject.toml | 2 ++ integrations/instructor_embedders/pyproject.toml | 2 ++ integrations/jina/pyproject.toml | 2 ++ integrations/langfuse/pyproject.toml | 11 ++++++----- .../llama_cpp/examples/rag_pipeline_example.py | 1 - integrations/llama_cpp/pyproject.toml | 2 ++ integrations/mistral/pyproject.toml | 2 ++ .../mistral/tests/test_mistral_chat_generator.py | 3 ++- .../mistral/tests/test_mistral_document_embedder.py | 1 + .../mistral/tests/test_mistral_text_embedder.py | 1 + integrations/mongodb_atlas/pyproject.toml | 2 ++ integrations/nvidia/pyproject.toml | 2 ++ integrations/ollama/pyproject.toml | 2 ++ integrations/opensearch/pyproject.toml | 2 ++ .../retrievers/opensearch/bm25_retriever.py | 1 - .../retrievers/opensearch/embedding_retriever.py | 1 - .../document_stores/opensearch/document_store.py | 5 ++--- integrations/optimum/pyproject.toml | 4 +++- integrations/pgvector/examples/embedding_retrieval.py | 1 - integrations/pgvector/examples/hybrid_retrieval.py | 1 - integrations/pgvector/pyproject.toml | 2 ++ .../retrievers/pgvector/embedding_retriever.py | 1 - .../retrievers/pgvector/keyword_retriever.py | 1 - integrations/pinecone/pyproject.toml | 2 ++ integrations/qdrant/examples/embedding_retrieval.py | 1 - integrations/qdrant/pyproject.toml | 2 ++ .../components/retrievers/qdrant/retriever.py | 3 +-- .../document_stores/qdrant/migrate_to_sparse.py | 3 +-- integrations/ragas/pyproject.toml | 4 +++- integrations/snowflake/pyproject.toml | 2 ++ .../snowflake/tests/test_snowflake_table_retriever.py | 2 +- integrations/unstructured/pyproject.toml | 2 ++ integrations/unstructured/tests/test_converter.py | 1 + integrations/weaviate/pyproject.toml | 8 +++++--- 58 files changed, 90 insertions(+), 44 deletions(-) diff --git a/integrations/amazon_bedrock/pyproject.toml b/integrations/amazon_bedrock/pyproject.toml index df968c34f..1298abfab 100644 --- a/integrations/amazon_bedrock/pyproject.toml +++ b/integrations/amazon_bedrock/pyproject.toml @@ -79,6 +79,8 @@ skip-string-normalization = true [tool.ruff] target-version = "py38" line-length = 120 + +[tool.ruff.lint] select = [ "A", "ARG", diff --git a/integrations/amazon_sagemaker/pyproject.toml b/integrations/amazon_sagemaker/pyproject.toml index e0bc39eae..a25b806f6 100644 --- a/integrations/amazon_sagemaker/pyproject.toml +++ b/integrations/amazon_sagemaker/pyproject.toml @@ -81,6 +81,8 @@ skip-string-normalization = true [tool.ruff] target-version = "py38" line-length = 120 + +[tool.ruff.lint] select = [ "A", "ARG", diff --git a/integrations/anthropic/pyproject.toml b/integrations/anthropic/pyproject.toml index 4a0a3ad3a..987f017be 100644 --- a/integrations/anthropic/pyproject.toml +++ b/integrations/anthropic/pyproject.toml @@ -79,6 +79,8 @@ skip-string-normalization = true [tool.ruff] target-version = "py38" line-length = 120 + +[tool.ruff.lint] select = [ "A", "ARG", diff --git a/integrations/astra/pyproject.toml b/integrations/astra/pyproject.toml index 7d543ddc9..9ecbd43df 100644 --- a/integrations/astra/pyproject.toml +++ b/integrations/astra/pyproject.toml @@ -78,7 +78,9 @@ skip-string-normalization = true [tool.ruff] target-version = "py38" line-length = 120 -lint.select = [ + +[tool.ruff.lint] +select = [ "A", "ARG", "B", @@ -105,7 +107,7 @@ lint.select = [ "W", "YTT", ] -lint.ignore = [ +ignore = [ # Allow non-abstract empty methods in abstract base classes "B027", # Allow boolean positional values in function calls, like `dict.get(... True)` @@ -121,11 +123,11 @@ lint.ignore = [ "PLR0913", "PLR0915", ] -lint.unfixable = [ +unfixable = [ # Don't touch unused imports "F401", ] -lint.exclude = ["example"] +exclude = ["example"] [tool.ruff.lint.isort] known-first-party = ["haystack_integrations"] diff --git a/integrations/chroma/pyproject.toml b/integrations/chroma/pyproject.toml index fc462a62d..5c7662fd2 100644 --- a/integrations/chroma/pyproject.toml +++ b/integrations/chroma/pyproject.toml @@ -85,7 +85,9 @@ skip-string-normalization = true [tool.ruff] target-version = "py38" line-length = 120 -lint.select = [ + +[tool.ruff.lint] +select = [ "A", "ARG", "B", @@ -112,7 +114,7 @@ lint.select = [ "W", "YTT", ] -lint.ignore = [ +ignore = [ # Allow non-abstract empty methods in abstract base classes "B027", # Allow boolean positional values in function calls, like `dict.get(... True)` @@ -130,7 +132,7 @@ lint.ignore = [ # Ignore unused params "ARG002", ] -lint.unfixable = [ +unfixable = [ # Don't touch unused imports "F401", ] diff --git a/integrations/cohere/examples/cohere_embedding.py b/integrations/cohere/examples/cohere_embedding.py index 75131de86..e6fe3cc35 100644 --- a/integrations/cohere/examples/cohere_embedding.py +++ b/integrations/cohere/examples/cohere_embedding.py @@ -1,7 +1,6 @@ from haystack import Document, Pipeline from haystack.components.retrievers.in_memory import InMemoryEmbeddingRetriever from haystack.document_stores.in_memory import InMemoryDocumentStore - from haystack_integrations.components.embedders.cohere.document_embedder import CohereDocumentEmbedder from haystack_integrations.components.embedders.cohere.text_embedder import CohereTextEmbedder diff --git a/integrations/cohere/examples/cohere_generation.py b/integrations/cohere/examples/cohere_generation.py index 3baec6327..cd79e37d3 100644 --- a/integrations/cohere/examples/cohere_generation.py +++ b/integrations/cohere/examples/cohere_generation.py @@ -20,7 +20,6 @@ from haystack.components.joiners import BranchJoiner from haystack.components.validators import JsonSchemaValidator from haystack.dataclasses import ChatMessage - from haystack_integrations.components.generators.cohere import CohereChatGenerator # Defines a JSON schema for validating a person's data. The schema specifies that a valid object must diff --git a/integrations/cohere/examples/cohere_ranker.py b/integrations/cohere/examples/cohere_ranker.py index b66ca1aae..79a3d346d 100644 --- a/integrations/cohere/examples/cohere_ranker.py +++ b/integrations/cohere/examples/cohere_ranker.py @@ -1,7 +1,6 @@ from haystack import Document, Pipeline from haystack.components.retrievers.in_memory import InMemoryBM25Retriever from haystack.document_stores.in_memory import InMemoryDocumentStore - from haystack_integrations.components.rankers.cohere import CohereRanker # Note set your API key by running the below command in your terminal diff --git a/integrations/cohere/pyproject.toml b/integrations/cohere/pyproject.toml index 0f17cb281..0a79c2765 100644 --- a/integrations/cohere/pyproject.toml +++ b/integrations/cohere/pyproject.toml @@ -79,6 +79,8 @@ skip-string-normalization = true [tool.ruff] target-version = "py38" line-length = 120 + +[tool.ruff.lint] select = [ "A", "ARG", diff --git a/integrations/cohere/src/haystack_integrations/components/embedders/cohere/document_embedder.py b/integrations/cohere/src/haystack_integrations/components/embedders/cohere/document_embedder.py index 3201168a8..59a04cf3c 100644 --- a/integrations/cohere/src/haystack_integrations/components/embedders/cohere/document_embedder.py +++ b/integrations/cohere/src/haystack_integrations/components/embedders/cohere/document_embedder.py @@ -6,9 +6,9 @@ from haystack import Document, component, default_from_dict, default_to_dict from haystack.utils import Secret, deserialize_secrets_inplace +from haystack_integrations.components.embedders.cohere.utils import get_async_response, get_response from cohere import AsyncClient, Client -from haystack_integrations.components.embedders.cohere.utils import get_async_response, get_response @component diff --git a/integrations/cohere/src/haystack_integrations/components/embedders/cohere/text_embedder.py b/integrations/cohere/src/haystack_integrations/components/embedders/cohere/text_embedder.py index c1e9bd613..80ede51bf 100644 --- a/integrations/cohere/src/haystack_integrations/components/embedders/cohere/text_embedder.py +++ b/integrations/cohere/src/haystack_integrations/components/embedders/cohere/text_embedder.py @@ -6,9 +6,9 @@ from haystack import component, default_from_dict, default_to_dict from haystack.utils import Secret, deserialize_secrets_inplace +from haystack_integrations.components.embedders.cohere.utils import get_async_response, get_response from cohere import AsyncClient, Client -from haystack_integrations.components.embedders.cohere.utils import get_async_response, get_response @component diff --git a/integrations/cohere/tests/test_cohere_chat_generator.py b/integrations/cohere/tests/test_cohere_chat_generator.py index fe9b7f43e..175a6d14b 100644 --- a/integrations/cohere/tests/test_cohere_chat_generator.py +++ b/integrations/cohere/tests/test_cohere_chat_generator.py @@ -7,6 +7,7 @@ from haystack.components.generators.utils import print_streaming_chunk from haystack.dataclasses import ChatMessage, ChatRole, StreamingChunk from haystack.utils import Secret + from haystack_integrations.components.generators.cohere import CohereChatGenerator pytestmark = pytest.mark.chat_generators diff --git a/integrations/cohere/tests/test_cohere_generator.py b/integrations/cohere/tests/test_cohere_generator.py index 736b6bfbf..60ee6ac93 100644 --- a/integrations/cohere/tests/test_cohere_generator.py +++ b/integrations/cohere/tests/test_cohere_generator.py @@ -7,6 +7,7 @@ from cohere.core import ApiError from haystack.components.generators.utils import print_streaming_chunk from haystack.utils import Secret + from haystack_integrations.components.generators.cohere import CohereGenerator pytestmark = pytest.mark.generators diff --git a/integrations/cohere/tests/test_cohere_ranker.py b/integrations/cohere/tests/test_cohere_ranker.py index 670e662d4..ff861b39d 100644 --- a/integrations/cohere/tests/test_cohere_ranker.py +++ b/integrations/cohere/tests/test_cohere_ranker.py @@ -4,6 +4,7 @@ import pytest from haystack import Document from haystack.utils.auth import Secret + from haystack_integrations.components.rankers.cohere import CohereRanker pytestmark = pytest.mark.ranker diff --git a/integrations/cohere/tests/test_document_embedder.py b/integrations/cohere/tests/test_document_embedder.py index ffbf280e9..d69e1a5a2 100644 --- a/integrations/cohere/tests/test_document_embedder.py +++ b/integrations/cohere/tests/test_document_embedder.py @@ -6,6 +6,7 @@ import pytest from haystack import Document from haystack.utils import Secret + from haystack_integrations.components.embedders.cohere import CohereDocumentEmbedder pytestmark = pytest.mark.embedders diff --git a/integrations/cohere/tests/test_text_embedder.py b/integrations/cohere/tests/test_text_embedder.py index b4f3e234c..80f7c1a3e 100644 --- a/integrations/cohere/tests/test_text_embedder.py +++ b/integrations/cohere/tests/test_text_embedder.py @@ -5,6 +5,7 @@ import pytest from haystack.utils import Secret + from haystack_integrations.components.embedders.cohere import CohereTextEmbedder pytestmark = pytest.mark.embedders diff --git a/integrations/deepeval/pyproject.toml b/integrations/deepeval/pyproject.toml index 9feb4f653..f421b514a 100644 --- a/integrations/deepeval/pyproject.toml +++ b/integrations/deepeval/pyproject.toml @@ -71,6 +71,9 @@ skip-string-normalization = true [tool.ruff] target-version = "py38" line-length = 120 +extend-exclude = ["tests", "example"] + +[tool.ruff.lint] select = [ "A", "ARG", @@ -121,7 +124,6 @@ unfixable = [ # Don't touch unused imports "F401", ] -extend-exclude = ["tests", "example"] [tool.ruff.lint.isort] known-first-party = ["src"] diff --git a/integrations/elasticsearch/pyproject.toml b/integrations/elasticsearch/pyproject.toml index bb70d5bb9..325e7ee62 100644 --- a/integrations/elasticsearch/pyproject.toml +++ b/integrations/elasticsearch/pyproject.toml @@ -80,6 +80,8 @@ skip-string-normalization = true [tool.ruff] target-version = "py38" line-length = 120 + +[tool.ruff.lint] select = [ "A", "ARG", diff --git a/integrations/elasticsearch/src/haystack_integrations/components/retrievers/elasticsearch/bm25_retriever.py b/integrations/elasticsearch/src/haystack_integrations/components/retrievers/elasticsearch/bm25_retriever.py index c25bd1e81..f273c955b 100644 --- a/integrations/elasticsearch/src/haystack_integrations/components/retrievers/elasticsearch/bm25_retriever.py +++ b/integrations/elasticsearch/src/haystack_integrations/components/retrievers/elasticsearch/bm25_retriever.py @@ -7,7 +7,6 @@ from haystack.dataclasses import Document from haystack.document_stores.types import FilterPolicy from haystack.document_stores.types.filter_policy import apply_filter_policy - from haystack_integrations.document_stores.elasticsearch.document_store import ElasticsearchDocumentStore diff --git a/integrations/elasticsearch/src/haystack_integrations/components/retrievers/elasticsearch/embedding_retriever.py b/integrations/elasticsearch/src/haystack_integrations/components/retrievers/elasticsearch/embedding_retriever.py index b8cebc544..10e860ea4 100644 --- a/integrations/elasticsearch/src/haystack_integrations/components/retrievers/elasticsearch/embedding_retriever.py +++ b/integrations/elasticsearch/src/haystack_integrations/components/retrievers/elasticsearch/embedding_retriever.py @@ -7,7 +7,6 @@ from haystack.dataclasses import Document from haystack.document_stores.types import FilterPolicy from haystack.document_stores.types.filter_policy import apply_filter_policy - from haystack_integrations.document_stores.elasticsearch.document_store import ElasticsearchDocumentStore diff --git a/integrations/fastembed/examples/example.py b/integrations/fastembed/examples/example.py index 640abd33b..e4d328210 100644 --- a/integrations/fastembed/examples/example.py +++ b/integrations/fastembed/examples/example.py @@ -1,7 +1,6 @@ from haystack import Document, Pipeline from haystack.components.retrievers.in_memory import InMemoryEmbeddingRetriever from haystack.document_stores.in_memory import InMemoryDocumentStore - from haystack_integrations.components.embedders.fastembed import FastembedDocumentEmbedder, FastembedTextEmbedder document_store = InMemoryDocumentStore(embedding_similarity_function="cosine") diff --git a/integrations/fastembed/examples/sparse_example.py b/integrations/fastembed/examples/sparse_example.py index 206788f18..bce3b363d 100644 --- a/integrations/fastembed/examples/sparse_example.py +++ b/integrations/fastembed/examples/sparse_example.py @@ -4,7 +4,6 @@ # involving indexing and retrieval of documents. from haystack import Document - from haystack_integrations.components.embedders.fastembed import FastembedSparseDocumentEmbedder document_list = [ diff --git a/integrations/fastembed/pyproject.toml b/integrations/fastembed/pyproject.toml index e3868507f..48294fdae 100644 --- a/integrations/fastembed/pyproject.toml +++ b/integrations/fastembed/pyproject.toml @@ -78,6 +78,8 @@ skip-string-normalization = true [tool.ruff] target-version = "py38" line-length = 120 + +[tool.ruff.lint] select = [ "A", "ARG", diff --git a/integrations/google_ai/pyproject.toml b/integrations/google_ai/pyproject.toml index f14ba4a34..d06e0a53f 100644 --- a/integrations/google_ai/pyproject.toml +++ b/integrations/google_ai/pyproject.toml @@ -75,6 +75,8 @@ skip-string-normalization = true [tool.ruff] target-version = "py38" line-length = 120 + +[tool.ruff.lint] select = [ "A", "ARG", diff --git a/integrations/google_vertex/pyproject.toml b/integrations/google_vertex/pyproject.toml index ff45c97e7..a0cefbcd4 100644 --- a/integrations/google_vertex/pyproject.toml +++ b/integrations/google_vertex/pyproject.toml @@ -75,6 +75,8 @@ skip-string-normalization = true [tool.ruff] target-version = "py38" line-length = 120 + +[tool.ruff.lint] select = [ "A", "ARG", diff --git a/integrations/instructor_embedders/pyproject.toml b/integrations/instructor_embedders/pyproject.toml index 4ace07ffc..5a904c812 100644 --- a/integrations/instructor_embedders/pyproject.toml +++ b/integrations/instructor_embedders/pyproject.toml @@ -105,6 +105,8 @@ exclude_lines = ["no cov", "if __name__ == .__main__.:", "if TYPE_CHECKING:"] [tool.ruff] target-version = "py38" line-length = 120 + +[tool.ruff.lint] select = [ "A", "ARG", diff --git a/integrations/jina/pyproject.toml b/integrations/jina/pyproject.toml index 74ce63a3c..259fc5fd2 100644 --- a/integrations/jina/pyproject.toml +++ b/integrations/jina/pyproject.toml @@ -74,6 +74,8 @@ skip-string-normalization = true [tool.ruff] target-version = "py38" line-length = 120 + +[tool.ruff.lint] select = [ "A", "ARG", diff --git a/integrations/langfuse/pyproject.toml b/integrations/langfuse/pyproject.toml index 04d85f740..b3d8c38d4 100644 --- a/integrations/langfuse/pyproject.toml +++ b/integrations/langfuse/pyproject.toml @@ -84,7 +84,10 @@ skip-string-normalization = true [tool.ruff] target-version = "py38" line-length = 120 -lint.select = [ +extend-exclude = ["tests", "example"] + +[tool.ruff.lint] +select = [ "A", "ARG", "B", @@ -110,8 +113,7 @@ lint.select = [ "W", "YTT", ] - -lint.ignore = [ +ignore = [ # Allow non-abstract empty methods in abstract base classes "B027", # Ignore checks for possible passwords @@ -127,11 +129,10 @@ lint.ignore = [ # Asserts "S101", ] -lint.unfixable = [ +unfixable = [ # Don't touch unused imports "F401", ] -extend-exclude = ["tests", "example"] [tool.ruff.lint.isort] known-first-party = ["src"] diff --git a/integrations/llama_cpp/examples/rag_pipeline_example.py b/integrations/llama_cpp/examples/rag_pipeline_example.py index 01ee11b98..dcab6dbd6 100644 --- a/integrations/llama_cpp/examples/rag_pipeline_example.py +++ b/integrations/llama_cpp/examples/rag_pipeline_example.py @@ -6,7 +6,6 @@ from haystack.components.retrievers import InMemoryEmbeddingRetriever from haystack.components.writers import DocumentWriter from haystack.document_stores import InMemoryDocumentStore - from haystack_integrations.components.generators.llama_cpp import LlamaCppGenerator # Load first 100 rows of the Simple Wikipedia Dataset from HuggingFace diff --git a/integrations/llama_cpp/pyproject.toml b/integrations/llama_cpp/pyproject.toml index b7498db5e..570042c62 100644 --- a/integrations/llama_cpp/pyproject.toml +++ b/integrations/llama_cpp/pyproject.toml @@ -88,6 +88,8 @@ skip-string-normalization = true [tool.ruff] target-version = "py38" line-length = 120 + +[tool.ruff.lint] select = [ "A", "ARG", diff --git a/integrations/mistral/pyproject.toml b/integrations/mistral/pyproject.toml index 32817d271..3949eb713 100644 --- a/integrations/mistral/pyproject.toml +++ b/integrations/mistral/pyproject.toml @@ -79,6 +79,8 @@ skip-string-normalization = true [tool.ruff] target-version = "py38" line-length = 120 + +[tool.ruff.lint] select = [ "A", "ARG", diff --git a/integrations/mistral/tests/test_mistral_chat_generator.py b/integrations/mistral/tests/test_mistral_chat_generator.py index 181397c00..3c95f19db 100644 --- a/integrations/mistral/tests/test_mistral_chat_generator.py +++ b/integrations/mistral/tests/test_mistral_chat_generator.py @@ -7,11 +7,12 @@ from haystack.components.generators.utils import print_streaming_chunk from haystack.dataclasses import ChatMessage, StreamingChunk from haystack.utils.auth import Secret -from haystack_integrations.components.generators.mistral.chat.chat_generator import MistralChatGenerator from openai import OpenAIError from openai.types.chat import ChatCompletion, ChatCompletionMessage from openai.types.chat.chat_completion import Choice +from haystack_integrations.components.generators.mistral.chat.chat_generator import MistralChatGenerator + @pytest.fixture def chat_messages(): diff --git a/integrations/mistral/tests/test_mistral_document_embedder.py b/integrations/mistral/tests/test_mistral_document_embedder.py index 6e5c11759..4e710e45d 100644 --- a/integrations/mistral/tests/test_mistral_document_embedder.py +++ b/integrations/mistral/tests/test_mistral_document_embedder.py @@ -6,6 +6,7 @@ import pytest from haystack import Document from haystack.utils import Secret + from haystack_integrations.components.embedders.mistral.document_embedder import MistralDocumentEmbedder pytestmark = pytest.mark.embedders diff --git a/integrations/mistral/tests/test_mistral_text_embedder.py b/integrations/mistral/tests/test_mistral_text_embedder.py index af004b022..175a96e0f 100644 --- a/integrations/mistral/tests/test_mistral_text_embedder.py +++ b/integrations/mistral/tests/test_mistral_text_embedder.py @@ -5,6 +5,7 @@ import pytest from haystack.utils import Secret + from haystack_integrations.components.embedders.mistral.text_embedder import MistralTextEmbedder pytestmark = pytest.mark.embedders diff --git a/integrations/mongodb_atlas/pyproject.toml b/integrations/mongodb_atlas/pyproject.toml index 2f1cfe507..d177c0524 100644 --- a/integrations/mongodb_atlas/pyproject.toml +++ b/integrations/mongodb_atlas/pyproject.toml @@ -78,6 +78,8 @@ skip-string-normalization = true [tool.ruff] target-version = "py38" line-length = 120 + +[tool.ruff.lint] select = [ "A", "ARG", diff --git a/integrations/nvidia/pyproject.toml b/integrations/nvidia/pyproject.toml index 05aa642d8..9f4363eb4 100644 --- a/integrations/nvidia/pyproject.toml +++ b/integrations/nvidia/pyproject.toml @@ -81,6 +81,8 @@ skip-string-normalization = true [tool.ruff] target-version = "py38" line-length = 120 + +[tool.ruff.lint] select = [ "A", "ARG", diff --git a/integrations/ollama/pyproject.toml b/integrations/ollama/pyproject.toml index 37465dd8d..f16b4c261 100644 --- a/integrations/ollama/pyproject.toml +++ b/integrations/ollama/pyproject.toml @@ -89,6 +89,8 @@ skip-string-normalization = true [tool.ruff] target-version = "py38" line-length = 120 + +[tool.ruff.lint] select = [ "A", "ARG", diff --git a/integrations/opensearch/pyproject.toml b/integrations/opensearch/pyproject.toml index f707cd15a..bdf251a2e 100644 --- a/integrations/opensearch/pyproject.toml +++ b/integrations/opensearch/pyproject.toml @@ -82,6 +82,8 @@ skip-string-normalization = true [tool.ruff] target-version = "py38" line-length = 120 + +[tool.ruff.lint] select = [ "A", "ARG", diff --git a/integrations/opensearch/src/haystack_integrations/components/retrievers/opensearch/bm25_retriever.py b/integrations/opensearch/src/haystack_integrations/components/retrievers/opensearch/bm25_retriever.py index 4a8478e2c..f09799e85 100644 --- a/integrations/opensearch/src/haystack_integrations/components/retrievers/opensearch/bm25_retriever.py +++ b/integrations/opensearch/src/haystack_integrations/components/retrievers/opensearch/bm25_retriever.py @@ -8,7 +8,6 @@ from haystack.dataclasses import Document from haystack.document_stores.types import FilterPolicy from haystack.document_stores.types.filter_policy import apply_filter_policy - from haystack_integrations.document_stores.opensearch import OpenSearchDocumentStore logger = logging.getLogger(__name__) diff --git a/integrations/opensearch/src/haystack_integrations/components/retrievers/opensearch/embedding_retriever.py b/integrations/opensearch/src/haystack_integrations/components/retrievers/opensearch/embedding_retriever.py index e159634cf..6e2287da3 100644 --- a/integrations/opensearch/src/haystack_integrations/components/retrievers/opensearch/embedding_retriever.py +++ b/integrations/opensearch/src/haystack_integrations/components/retrievers/opensearch/embedding_retriever.py @@ -8,7 +8,6 @@ from haystack.dataclasses import Document from haystack.document_stores.types import FilterPolicy from haystack.document_stores.types.filter_policy import apply_filter_policy - from haystack_integrations.document_stores.opensearch import OpenSearchDocumentStore logger = logging.getLogger(__name__) diff --git a/integrations/opensearch/src/haystack_integrations/document_stores/opensearch/document_store.py b/integrations/opensearch/src/haystack_integrations/document_stores/opensearch/document_store.py index 6f7a6c96e..44bfe65b8 100644 --- a/integrations/opensearch/src/haystack_integrations/document_stores/opensearch/document_store.py +++ b/integrations/opensearch/src/haystack_integrations/document_stores/opensearch/document_store.py @@ -9,11 +9,10 @@ from haystack.dataclasses import Document from haystack.document_stores.errors import DocumentStoreError, DuplicateDocumentError from haystack.document_stores.types import DuplicatePolicy -from opensearchpy import OpenSearch -from opensearchpy.helpers import bulk - from haystack_integrations.document_stores.opensearch.auth import AWSAuth from haystack_integrations.document_stores.opensearch.filters import normalize_filters +from opensearchpy import OpenSearch +from opensearchpy.helpers import bulk logger = logging.getLogger(__name__) diff --git a/integrations/optimum/pyproject.toml b/integrations/optimum/pyproject.toml index fe028204d..342878bb8 100644 --- a/integrations/optimum/pyproject.toml +++ b/integrations/optimum/pyproject.toml @@ -99,6 +99,9 @@ skip-string-normalization = true [tool.ruff] target-version = "py38" line-length = 120 +extend-exclude = ["tests", "example"] + +[tool.ruff.lint] select = [ "A", "ARG", @@ -145,7 +148,6 @@ unfixable = [ # Don't touch unused imports "F401", ] -extend-exclude = ["tests", "example"] [tool.ruff.lint.flake8-tidy-imports] ban-relative-imports = "parents" diff --git a/integrations/pgvector/examples/embedding_retrieval.py b/integrations/pgvector/examples/embedding_retrieval.py index b20a7a143..37ea88929 100644 --- a/integrations/pgvector/examples/embedding_retrieval.py +++ b/integrations/pgvector/examples/embedding_retrieval.py @@ -17,7 +17,6 @@ from haystack.components.embedders import SentenceTransformersDocumentEmbedder, SentenceTransformersTextEmbedder from haystack.components.preprocessors import DocumentSplitter from haystack.components.writers import DocumentWriter - from haystack_integrations.components.retrievers.pgvector import PgvectorEmbeddingRetriever from haystack_integrations.document_stores.pgvector import PgvectorDocumentStore diff --git a/integrations/pgvector/examples/hybrid_retrieval.py b/integrations/pgvector/examples/hybrid_retrieval.py index 7d110f60e..cee98fe08 100644 --- a/integrations/pgvector/examples/hybrid_retrieval.py +++ b/integrations/pgvector/examples/hybrid_retrieval.py @@ -18,7 +18,6 @@ from haystack.components.joiners import DocumentJoiner from haystack.components.preprocessors import DocumentSplitter from haystack.components.writers import DocumentWriter - from haystack_integrations.components.retrievers.pgvector import PgvectorEmbeddingRetriever, PgvectorKeywordRetriever from haystack_integrations.document_stores.pgvector import PgvectorDocumentStore diff --git a/integrations/pgvector/pyproject.toml b/integrations/pgvector/pyproject.toml index a2234f936..a9c47d3bd 100644 --- a/integrations/pgvector/pyproject.toml +++ b/integrations/pgvector/pyproject.toml @@ -78,6 +78,8 @@ skip-string-normalization = true [tool.ruff] target-version = "py38" line-length = 120 + +[tool.ruff.lint] select = [ "A", "ARG", diff --git a/integrations/pgvector/src/haystack_integrations/components/retrievers/pgvector/embedding_retriever.py b/integrations/pgvector/src/haystack_integrations/components/retrievers/pgvector/embedding_retriever.py index 3df5261c6..22aab1a73 100644 --- a/integrations/pgvector/src/haystack_integrations/components/retrievers/pgvector/embedding_retriever.py +++ b/integrations/pgvector/src/haystack_integrations/components/retrievers/pgvector/embedding_retriever.py @@ -7,7 +7,6 @@ from haystack.dataclasses import Document from haystack.document_stores.types import FilterPolicy from haystack.document_stores.types.filter_policy import apply_filter_policy - from haystack_integrations.document_stores.pgvector import PgvectorDocumentStore from haystack_integrations.document_stores.pgvector.document_store import VALID_VECTOR_FUNCTIONS diff --git a/integrations/pgvector/src/haystack_integrations/components/retrievers/pgvector/keyword_retriever.py b/integrations/pgvector/src/haystack_integrations/components/retrievers/pgvector/keyword_retriever.py index 32f95da64..636471c31 100644 --- a/integrations/pgvector/src/haystack_integrations/components/retrievers/pgvector/keyword_retriever.py +++ b/integrations/pgvector/src/haystack_integrations/components/retrievers/pgvector/keyword_retriever.py @@ -7,7 +7,6 @@ from haystack.dataclasses import Document from haystack.document_stores.types import FilterPolicy from haystack.document_stores.types.filter_policy import apply_filter_policy - from haystack_integrations.document_stores.pgvector import PgvectorDocumentStore diff --git a/integrations/pinecone/pyproject.toml b/integrations/pinecone/pyproject.toml index 7895cfb83..3f2e4d6bd 100644 --- a/integrations/pinecone/pyproject.toml +++ b/integrations/pinecone/pyproject.toml @@ -85,6 +85,8 @@ skip-string-normalization = true [tool.ruff] target-version = "py38" line-length = 120 + +[tool.ruff.lint] select = [ "A", "ARG", diff --git a/integrations/qdrant/examples/embedding_retrieval.py b/integrations/qdrant/examples/embedding_retrieval.py index 84f12f4fe..f009191e7 100644 --- a/integrations/qdrant/examples/embedding_retrieval.py +++ b/integrations/qdrant/examples/embedding_retrieval.py @@ -12,7 +12,6 @@ from haystack.components.embedders import SentenceTransformersDocumentEmbedder, SentenceTransformersTextEmbedder from haystack.components.preprocessors import DocumentSplitter from haystack.components.writers import DocumentWriter - from haystack_integrations.components.retrievers.qdrant import QdrantEmbeddingRetriever from haystack_integrations.document_stores.qdrant import QdrantDocumentStore diff --git a/integrations/qdrant/pyproject.toml b/integrations/qdrant/pyproject.toml index 1bfba3cac..59dacc36c 100644 --- a/integrations/qdrant/pyproject.toml +++ b/integrations/qdrant/pyproject.toml @@ -74,6 +74,8 @@ skip-string-normalization = true [tool.ruff] target-version = "py38" line-length = 120 + +[tool.ruff.lint] select = [ "A", "ARG", diff --git a/integrations/qdrant/src/haystack_integrations/components/retrievers/qdrant/retriever.py b/integrations/qdrant/src/haystack_integrations/components/retrievers/qdrant/retriever.py index fee9a6182..334df9bb8 100644 --- a/integrations/qdrant/src/haystack_integrations/components/retrievers/qdrant/retriever.py +++ b/integrations/qdrant/src/haystack_integrations/components/retrievers/qdrant/retriever.py @@ -4,9 +4,8 @@ from haystack.dataclasses.sparse_embedding import SparseEmbedding from haystack.document_stores.types import FilterPolicy from haystack.document_stores.types.filter_policy import apply_filter_policy -from qdrant_client.http import models - from haystack_integrations.document_stores.qdrant import QdrantDocumentStore +from qdrant_client.http import models @component diff --git a/integrations/qdrant/src/haystack_integrations/document_stores/qdrant/migrate_to_sparse.py b/integrations/qdrant/src/haystack_integrations/document_stores/qdrant/migrate_to_sparse.py index 9eb4ca088..1fabbfd9c 100644 --- a/integrations/qdrant/src/haystack_integrations/document_stores/qdrant/migrate_to_sparse.py +++ b/integrations/qdrant/src/haystack_integrations/document_stores/qdrant/migrate_to_sparse.py @@ -1,9 +1,8 @@ import logging import time -from qdrant_client.http import models - from haystack_integrations.document_stores.qdrant import QdrantDocumentStore +from qdrant_client.http import models logger = logging.getLogger(__name__) logger.addHandler(logging.StreamHandler()) diff --git a/integrations/ragas/pyproject.toml b/integrations/ragas/pyproject.toml index 898e1ad10..cc129931a 100644 --- a/integrations/ragas/pyproject.toml +++ b/integrations/ragas/pyproject.toml @@ -77,6 +77,9 @@ skip-string-normalization = true [tool.ruff] target-version = "py38" line-length = 120 +extend-exclude = ["tests", "example"] + +[tool.ruff.lint] select = [ "A", "ARG", @@ -128,7 +131,6 @@ unfixable = [ # Don't touch unused imports "F401", ] -extend-exclude = ["tests", "example"] [tool.ruff.lint.isort] known-first-party = ["src"] diff --git a/integrations/snowflake/pyproject.toml b/integrations/snowflake/pyproject.toml index 388c87158..f5e87e334 100644 --- a/integrations/snowflake/pyproject.toml +++ b/integrations/snowflake/pyproject.toml @@ -74,6 +74,8 @@ skip-string-normalization = true [tool.ruff] target-version = "py38" line-length = 120 + +[tool.ruff.lint] select = [ "A", "ARG", diff --git a/integrations/snowflake/tests/test_snowflake_table_retriever.py b/integrations/snowflake/tests/test_snowflake_table_retriever.py index 547f7e1b1..c68e96c1f 100644 --- a/integrations/snowflake/tests/test_snowflake_table_retriever.py +++ b/integrations/snowflake/tests/test_snowflake_table_retriever.py @@ -10,9 +10,9 @@ import pytest from dateutil.tz import tzlocal from haystack import Pipeline +from haystack.components.builders import PromptBuilder from haystack.components.converters import OutputAdapter from haystack.components.generators import OpenAIGenerator -from haystack.components.builders import PromptBuilder from haystack.utils import Secret from openai.types.chat import ChatCompletion, ChatCompletionMessage from openai.types.chat.chat_completion import Choice diff --git a/integrations/unstructured/pyproject.toml b/integrations/unstructured/pyproject.toml index fd668db44..ba4d700c6 100644 --- a/integrations/unstructured/pyproject.toml +++ b/integrations/unstructured/pyproject.toml @@ -82,6 +82,8 @@ skip-string-normalization = true [tool.ruff] target-version = "py38" line-length = 120 + +[tool.ruff.lint] select = [ "A", "ARG", diff --git a/integrations/unstructured/tests/test_converter.py b/integrations/unstructured/tests/test_converter.py index 5d1a6c091..063289b07 100644 --- a/integrations/unstructured/tests/test_converter.py +++ b/integrations/unstructured/tests/test_converter.py @@ -2,6 +2,7 @@ # # SPDX-License-Identifier: Apache-2.0 import pytest + from haystack_integrations.components.converters.unstructured import UnstructuredFileConverter diff --git a/integrations/weaviate/pyproject.toml b/integrations/weaviate/pyproject.toml index 9598abd94..06546492e 100644 --- a/integrations/weaviate/pyproject.toml +++ b/integrations/weaviate/pyproject.toml @@ -77,7 +77,9 @@ skip-string-normalization = true [tool.ruff] target-version = "py38" line-length = 120 -lint.select = [ + +[tool.ruff.lint] +select = [ "A", "ARG", "B", @@ -104,7 +106,7 @@ lint.select = [ "W", "YTT", ] -lint.ignore = [ +ignore = [ # Allow non-abstract empty methods in abstract base classes "B027", # Allow boolean positional values in function calls, like `dict.get(... True)` @@ -120,7 +122,7 @@ lint.ignore = [ "PLR0913", "PLR0915", ] -lint.unfixable = [ +unfixable = [ # Don't touch unused imports "F401", ] From 6f499975be32bb9518c3001f45f00f8e2704a472 Mon Sep 17 00:00:00 2001 From: anakin87 Date: Wed, 25 Sep 2024 19:01:07 +0200 Subject: [PATCH 3/8] lint --- integrations/chroma/pyproject.toml | 4 ++-- integrations/cohere/pyproject.toml | 4 ++-- integrations/cohere/tests/test_cohere_chat_generator.py | 1 - integrations/cohere/tests/test_cohere_generator.py | 1 - integrations/cohere/tests/test_cohere_ranker.py | 1 - integrations/cohere/tests/test_document_embedder.py | 1 - integrations/cohere/tests/test_text_embedder.py | 1 - integrations/elasticsearch/pyproject.toml | 4 ++-- integrations/elasticsearch/tests/test_bm25_retriever.py | 1 - integrations/elasticsearch/tests/test_document_store.py | 1 - .../elasticsearch/tests/test_embedding_retriever.py | 1 - integrations/elasticsearch/tests/test_filters.py | 1 - integrations/fastembed/pyproject.toml | 4 ++-- .../fastembed/tests/test_fastembed_document_embedder.py | 1 - .../tests/test_fastembed_sparse_document_embedder.py | 1 - .../tests/test_fastembed_sparse_text_embedder.py | 1 - .../fastembed/tests/test_fastembed_text_embedder.py | 1 - integrations/instructor_embedders/pyproject.toml | 4 ++-- .../instructor_embedders/tests/test_instructor_backend.py | 1 - .../tests/test_instructor_document_embedder.py | 1 - .../tests/test_instructor_text_embedder.py | 1 - integrations/jina/pyproject.toml | 4 ++-- integrations/jina/tests/test_document_embedder.py | 1 - integrations/jina/tests/test_ranker.py | 1 - integrations/jina/tests/test_text_embedder.py | 1 - integrations/langfuse/pyproject.toml | 4 ++-- integrations/llama_cpp/pyproject.toml | 4 ++-- integrations/llama_cpp/tests/test_chat_generator.py | 1 - integrations/llama_cpp/tests/test_generator.py | 1 - integrations/mistral/pyproject.toml | 4 ++-- integrations/mongodb_atlas/pyproject.toml | 4 ++-- integrations/nvidia/pyproject.toml | 4 ++-- integrations/opensearch/pyproject.toml | 4 ++-- integrations/opensearch/tests/test_auth.py | 3 +-- integrations/opensearch/tests/test_bm25_retriever.py | 1 - integrations/opensearch/tests/test_document_store.py | 3 +-- integrations/opensearch/tests/test_embedding_retriever.py | 1 - integrations/opensearch/tests/test_filters.py | 1 - integrations/pgvector/pyproject.toml | 4 ++-- integrations/pgvector/tests/conftest.py | 1 - integrations/pgvector/tests/test_document_store.py | 3 +-- integrations/pgvector/tests/test_embedding_retrieval.py | 3 +-- integrations/pgvector/tests/test_filters.py | 7 +++---- integrations/pgvector/tests/test_keyword_retrieval.py | 1 - integrations/pgvector/tests/test_retrievers.py | 1 - integrations/qdrant/pyproject.toml | 4 ++-- integrations/qdrant/tests/test_converters.py | 3 +-- integrations/qdrant/tests/test_dict_converters.py | 1 - integrations/qdrant/tests/test_document_store.py | 3 +-- integrations/qdrant/tests/test_filters.py | 3 +-- integrations/qdrant/tests/test_retriever.py | 1 - integrations/snowflake/pyproject.toml | 4 ++-- .../snowflake/tests/test_snowflake_table_retriever.py | 8 ++++++-- integrations/unstructured/pyproject.toml | 4 ++-- integrations/unstructured/tests/test_converter.py | 1 - integrations/weaviate/pyproject.toml | 4 ++-- 56 files changed, 50 insertions(+), 84 deletions(-) diff --git a/integrations/chroma/pyproject.toml b/integrations/chroma/pyproject.toml index 5c7662fd2..b2f22677d 100644 --- a/integrations/chroma/pyproject.toml +++ b/integrations/chroma/pyproject.toml @@ -70,8 +70,8 @@ dependencies = [ ] [tool.hatch.envs.lint.scripts] typing = "mypy --install-types --non-interactive --explicit-package-bases {args:src/ tests}" -style = ["ruff check {args:. --exclude tests/}", "black --check --diff {args:.}"] -fmt = ["black {args:.}", "ruff check --fix {args:. --exclude tests/}", "style"] +style = ["ruff check {args:.}", "black --check --diff {args:.}"] +fmt = ["black {args:.}", "ruff check --fix {args:.}", "style"] all = ["style", "typing"] [tool.hatch.metadata] diff --git a/integrations/cohere/pyproject.toml b/integrations/cohere/pyproject.toml index 0a79c2765..63e736de6 100644 --- a/integrations/cohere/pyproject.toml +++ b/integrations/cohere/pyproject.toml @@ -65,10 +65,10 @@ dependencies = ["black>=23.1.0", "mypy>=1.0.0", "ruff>=0.0.243"] [tool.hatch.envs.lint.scripts] typing = "mypy --install-types --non-interactive --explicit-package-bases {args:src/ tests}" style = [ - "ruff check {args:. --exclude tests/}", + "ruff check {args:}", "black --check --diff {args:.}", ] -fmt = ["black {args:.}", "ruff check --fix {args:. --exclude tests/}", "style"] +fmt = ["black {args:.}", "ruff check --fix {args:}", "style"] all = ["style", "typing"] [tool.black] diff --git a/integrations/cohere/tests/test_cohere_chat_generator.py b/integrations/cohere/tests/test_cohere_chat_generator.py index 175a6d14b..fe9b7f43e 100644 --- a/integrations/cohere/tests/test_cohere_chat_generator.py +++ b/integrations/cohere/tests/test_cohere_chat_generator.py @@ -7,7 +7,6 @@ from haystack.components.generators.utils import print_streaming_chunk from haystack.dataclasses import ChatMessage, ChatRole, StreamingChunk from haystack.utils import Secret - from haystack_integrations.components.generators.cohere import CohereChatGenerator pytestmark = pytest.mark.chat_generators diff --git a/integrations/cohere/tests/test_cohere_generator.py b/integrations/cohere/tests/test_cohere_generator.py index 60ee6ac93..736b6bfbf 100644 --- a/integrations/cohere/tests/test_cohere_generator.py +++ b/integrations/cohere/tests/test_cohere_generator.py @@ -7,7 +7,6 @@ from cohere.core import ApiError from haystack.components.generators.utils import print_streaming_chunk from haystack.utils import Secret - from haystack_integrations.components.generators.cohere import CohereGenerator pytestmark = pytest.mark.generators diff --git a/integrations/cohere/tests/test_cohere_ranker.py b/integrations/cohere/tests/test_cohere_ranker.py index ff861b39d..670e662d4 100644 --- a/integrations/cohere/tests/test_cohere_ranker.py +++ b/integrations/cohere/tests/test_cohere_ranker.py @@ -4,7 +4,6 @@ import pytest from haystack import Document from haystack.utils.auth import Secret - from haystack_integrations.components.rankers.cohere import CohereRanker pytestmark = pytest.mark.ranker diff --git a/integrations/cohere/tests/test_document_embedder.py b/integrations/cohere/tests/test_document_embedder.py index d69e1a5a2..ffbf280e9 100644 --- a/integrations/cohere/tests/test_document_embedder.py +++ b/integrations/cohere/tests/test_document_embedder.py @@ -6,7 +6,6 @@ import pytest from haystack import Document from haystack.utils import Secret - from haystack_integrations.components.embedders.cohere import CohereDocumentEmbedder pytestmark = pytest.mark.embedders diff --git a/integrations/cohere/tests/test_text_embedder.py b/integrations/cohere/tests/test_text_embedder.py index 80f7c1a3e..b4f3e234c 100644 --- a/integrations/cohere/tests/test_text_embedder.py +++ b/integrations/cohere/tests/test_text_embedder.py @@ -5,7 +5,6 @@ import pytest from haystack.utils import Secret - from haystack_integrations.components.embedders.cohere import CohereTextEmbedder pytestmark = pytest.mark.embedders diff --git a/integrations/elasticsearch/pyproject.toml b/integrations/elasticsearch/pyproject.toml index 325e7ee62..9cc3aba37 100644 --- a/integrations/elasticsearch/pyproject.toml +++ b/integrations/elasticsearch/pyproject.toml @@ -65,8 +65,8 @@ detached = true dependencies = ["black>=23.1.0", "mypy>=1.0.0", "ruff>=0.0.243"] [tool.hatch.envs.lint.scripts] typing = "mypy --install-types --non-interactive --explicit-package-bases {args:src/ tests}" -style = ["ruff check {args:. --exclude tests/}", "black --check --diff {args:.}"] -fmt = ["black {args:.}", "ruff check --fix {args:. --exclude tests/}", "style"] +style = ["ruff check {args:}", "black --check --diff {args:.}"] +fmt = ["black {args:.}", "ruff check --fix {args:}", "style"] all = ["style", "typing"] [tool.hatch.metadata] diff --git a/integrations/elasticsearch/tests/test_bm25_retriever.py b/integrations/elasticsearch/tests/test_bm25_retriever.py index c306c00b7..3e9ebc9b8 100644 --- a/integrations/elasticsearch/tests/test_bm25_retriever.py +++ b/integrations/elasticsearch/tests/test_bm25_retriever.py @@ -6,7 +6,6 @@ import pytest from haystack.dataclasses import Document from haystack.document_stores.types import FilterPolicy - from haystack_integrations.components.retrievers.elasticsearch import ElasticsearchBM25Retriever from haystack_integrations.document_stores.elasticsearch import ElasticsearchDocumentStore diff --git a/integrations/elasticsearch/tests/test_document_store.py b/integrations/elasticsearch/tests/test_document_store.py index 51a19b641..20b68f126 100644 --- a/integrations/elasticsearch/tests/test_document_store.py +++ b/integrations/elasticsearch/tests/test_document_store.py @@ -12,7 +12,6 @@ from haystack.document_stores.errors import DocumentStoreError, DuplicateDocumentError from haystack.document_stores.types import DuplicatePolicy from haystack.testing.document_store import DocumentStoreBaseTests - from haystack_integrations.document_stores.elasticsearch import ElasticsearchDocumentStore diff --git a/integrations/elasticsearch/tests/test_embedding_retriever.py b/integrations/elasticsearch/tests/test_embedding_retriever.py index 0725548bf..2d03f0ec2 100644 --- a/integrations/elasticsearch/tests/test_embedding_retriever.py +++ b/integrations/elasticsearch/tests/test_embedding_retriever.py @@ -6,7 +6,6 @@ import pytest from haystack.dataclasses import Document from haystack.document_stores.types import FilterPolicy - from haystack_integrations.components.retrievers.elasticsearch import ElasticsearchEmbeddingRetriever from haystack_integrations.document_stores.elasticsearch import ElasticsearchDocumentStore diff --git a/integrations/elasticsearch/tests/test_filters.py b/integrations/elasticsearch/tests/test_filters.py index 5f09f0a49..86e5cba74 100644 --- a/integrations/elasticsearch/tests/test_filters.py +++ b/integrations/elasticsearch/tests/test_filters.py @@ -3,7 +3,6 @@ # SPDX-License-Identifier: Apache-2.0 import pytest from haystack.errors import FilterError - from haystack_integrations.document_stores.elasticsearch.filters import _normalize_filters, _normalize_ranges filters_data = [ diff --git a/integrations/fastembed/pyproject.toml b/integrations/fastembed/pyproject.toml index 48294fdae..545d8d543 100644 --- a/integrations/fastembed/pyproject.toml +++ b/integrations/fastembed/pyproject.toml @@ -66,8 +66,8 @@ detached = true dependencies = ["black>=23.1.0", "mypy>=1.0.0", "ruff>=0.0.243", "numpy"] [tool.hatch.envs.lint.scripts] typing = "mypy --install-types --non-interactive --explicit-package-bases {args:src/ tests}" -style = ["ruff check {args:. --exclude tests/, examples/}", "black --check --diff {args:.}"] -fmt = ["black {args:.}", "ruff check --fix {args:. --exclude tests/, examples/}", "style"] +style = ["ruff check {args:.}", "black --check --diff {args:.}"] +fmt = ["black {args:.}", "ruff check --fix {args:.}", "style"] all = ["style", "typing"] [tool.black] diff --git a/integrations/fastembed/tests/test_fastembed_document_embedder.py b/integrations/fastembed/tests/test_fastembed_document_embedder.py index 8a7589de1..8afb89c69 100644 --- a/integrations/fastembed/tests/test_fastembed_document_embedder.py +++ b/integrations/fastembed/tests/test_fastembed_document_embedder.py @@ -3,7 +3,6 @@ import numpy as np import pytest from haystack import Document, default_from_dict - from haystack_integrations.components.embedders.fastembed.fastembed_document_embedder import ( FastembedDocumentEmbedder, ) diff --git a/integrations/fastembed/tests/test_fastembed_sparse_document_embedder.py b/integrations/fastembed/tests/test_fastembed_sparse_document_embedder.py index d3f2023b8..b4caca364 100644 --- a/integrations/fastembed/tests/test_fastembed_sparse_document_embedder.py +++ b/integrations/fastembed/tests/test_fastembed_sparse_document_embedder.py @@ -4,7 +4,6 @@ import pytest from haystack import Document, default_from_dict from haystack.dataclasses.sparse_embedding import SparseEmbedding - from haystack_integrations.components.embedders.fastembed.fastembed_sparse_document_embedder import ( FastembedSparseDocumentEmbedder, ) diff --git a/integrations/fastembed/tests/test_fastembed_sparse_text_embedder.py b/integrations/fastembed/tests/test_fastembed_sparse_text_embedder.py index 7e9197493..9e37df409 100644 --- a/integrations/fastembed/tests/test_fastembed_sparse_text_embedder.py +++ b/integrations/fastembed/tests/test_fastembed_sparse_text_embedder.py @@ -4,7 +4,6 @@ import pytest from haystack import default_from_dict from haystack.dataclasses.sparse_embedding import SparseEmbedding - from haystack_integrations.components.embedders.fastembed.fastembed_sparse_text_embedder import ( FastembedSparseTextEmbedder, ) diff --git a/integrations/fastembed/tests/test_fastembed_text_embedder.py b/integrations/fastembed/tests/test_fastembed_text_embedder.py index f1b2e21e9..f20a98b57 100644 --- a/integrations/fastembed/tests/test_fastembed_text_embedder.py +++ b/integrations/fastembed/tests/test_fastembed_text_embedder.py @@ -3,7 +3,6 @@ import numpy as np import pytest from haystack import default_from_dict - from haystack_integrations.components.embedders.fastembed.fastembed_text_embedder import ( FastembedTextEmbedder, ) diff --git a/integrations/instructor_embedders/pyproject.toml b/integrations/instructor_embedders/pyproject.toml index 5a904c812..42e71af5d 100644 --- a/integrations/instructor_embedders/pyproject.toml +++ b/integrations/instructor_embedders/pyproject.toml @@ -88,8 +88,8 @@ dependencies = ["black>=23.1.0", "mypy>=1.0.0", "ruff>=0.0.243"] [tool.hatch.envs.lint.scripts] typing = "mypy --install-types --non-interactive --explicit-package-bases {args:src/ tests}" -style = ["ruff check {args:. --exclude tests/}", "black --check --diff {args:.}"] -fmt = ["black {args:.}", "ruff check --fix {args:. --exclude tests/}", "style"] +style = ["ruff check {args:}", "black --check --diff {args:.}"] +fmt = ["black {args:.}", "ruff check --fix {args:}", "style"] all = ["style", "typing"] [tool.coverage.run] diff --git a/integrations/instructor_embedders/tests/test_instructor_backend.py b/integrations/instructor_embedders/tests/test_instructor_backend.py index fdf6e44be..85c1f012a 100644 --- a/integrations/instructor_embedders/tests/test_instructor_backend.py +++ b/integrations/instructor_embedders/tests/test_instructor_backend.py @@ -1,7 +1,6 @@ from unittest.mock import patch from haystack.utils.auth import Secret - from haystack_integrations.components.embedders.instructor_embedders.embedding_backend.instructor_backend import ( _InstructorEmbeddingBackendFactory, ) diff --git a/integrations/instructor_embedders/tests/test_instructor_document_embedder.py b/integrations/instructor_embedders/tests/test_instructor_document_embedder.py index f1676b411..44f740679 100644 --- a/integrations/instructor_embedders/tests/test_instructor_document_embedder.py +++ b/integrations/instructor_embedders/tests/test_instructor_document_embedder.py @@ -4,7 +4,6 @@ import pytest from haystack import Document from haystack.utils import ComponentDevice, Secret - from haystack_integrations.components.embedders.instructor_embedders import InstructorDocumentEmbedder diff --git a/integrations/instructor_embedders/tests/test_instructor_text_embedder.py b/integrations/instructor_embedders/tests/test_instructor_text_embedder.py index 68e3e5d62..55022f1ec 100644 --- a/integrations/instructor_embedders/tests/test_instructor_text_embedder.py +++ b/integrations/instructor_embedders/tests/test_instructor_text_embedder.py @@ -3,7 +3,6 @@ import numpy as np import pytest from haystack.utils import ComponentDevice, Secret - from haystack_integrations.components.embedders.instructor_embedders import InstructorTextEmbedder diff --git a/integrations/jina/pyproject.toml b/integrations/jina/pyproject.toml index 259fc5fd2..9484ec346 100644 --- a/integrations/jina/pyproject.toml +++ b/integrations/jina/pyproject.toml @@ -62,8 +62,8 @@ detached = true dependencies = ["black>=23.1.0", "mypy>=1.0.0", "ruff>=0.0.243"] [tool.hatch.envs.lint.scripts] typing = "mypy --install-types --non-interactive --explicit-package-bases {args:src/ tests}" -style = ["ruff check {args:. --exclude tests/}", "black --check --diff {args:.}"] -fmt = ["black {args:.}", "ruff check --fix {args:. --exclude tests/}", "style"] +style = ["ruff check {args:}", "black --check --diff {args:.}"] +fmt = ["black {args:.}", "ruff check --fix {args:}", "style"] all = ["style", "typing"] [tool.black] diff --git a/integrations/jina/tests/test_document_embedder.py b/integrations/jina/tests/test_document_embedder.py index 247b95eff..02d8fc70e 100644 --- a/integrations/jina/tests/test_document_embedder.py +++ b/integrations/jina/tests/test_document_embedder.py @@ -8,7 +8,6 @@ import requests from haystack import Document from haystack.utils import Secret - from haystack_integrations.components.embedders.jina import JinaDocumentEmbedder diff --git a/integrations/jina/tests/test_ranker.py b/integrations/jina/tests/test_ranker.py index e7fdaade0..7ece6806d 100644 --- a/integrations/jina/tests/test_ranker.py +++ b/integrations/jina/tests/test_ranker.py @@ -8,7 +8,6 @@ import requests from haystack import Document from haystack.utils import Secret - from haystack_integrations.components.rankers.jina import JinaRanker diff --git a/integrations/jina/tests/test_text_embedder.py b/integrations/jina/tests/test_text_embedder.py index 058712a18..a56b2f9ab 100644 --- a/integrations/jina/tests/test_text_embedder.py +++ b/integrations/jina/tests/test_text_embedder.py @@ -7,7 +7,6 @@ import pytest import requests from haystack.utils import Secret - from haystack_integrations.components.embedders.jina import JinaTextEmbedder diff --git a/integrations/langfuse/pyproject.toml b/integrations/langfuse/pyproject.toml index b3d8c38d4..61b8af793 100644 --- a/integrations/langfuse/pyproject.toml +++ b/integrations/langfuse/pyproject.toml @@ -69,8 +69,8 @@ dependencies = ["black>=23.1.0", "mypy>=1.0.0", "ruff>=0.0.243"] [tool.hatch.envs.lint.scripts] typing = "mypy --install-types --non-interactive --explicit-package-bases {args:src/ tests}" -style = ["ruff check {args:. --exclude tests/}", "black --check --diff {args:.}"] -fmt = ["black {args:.}", "ruff check --fix {args:. --exclude tests/}", "style"] +style = ["ruff check {args:}", "black --check --diff {args:.}"] +fmt = ["black {args:.}", "ruff check --fix {args:}", "style"] all = ["style", "typing"] [tool.hatch.metadata] diff --git a/integrations/llama_cpp/pyproject.toml b/integrations/llama_cpp/pyproject.toml index 570042c62..55fa3ea7b 100644 --- a/integrations/llama_cpp/pyproject.toml +++ b/integrations/llama_cpp/pyproject.toml @@ -70,8 +70,8 @@ dependencies = ["black>=23.1.0", "mypy>=1.0.0", "ruff>=0.0.243"] [tool.hatch.envs.lint.scripts] typing = "mypy --install-types --non-interactive --explicit-package-bases {args:src/ tests}" -style = ["ruff check {args:. --exclude tests/, examples/}", "black --check --diff {args:.}"] -fmt = ["black {args:.}", "ruff check --fix {args:. --exclude tests/, examples/}", "style"] +style = ["ruff check {args:.}", "black --check --diff {args:.}"] +fmt = ["black {args:.}", "ruff check --fix {args:.}", "style"] all = ["style", "typing"] [tool.hatch.metadata] diff --git a/integrations/llama_cpp/tests/test_chat_generator.py b/integrations/llama_cpp/tests/test_chat_generator.py index 1d4c9cf82..7bd6ef122 100644 --- a/integrations/llama_cpp/tests/test_chat_generator.py +++ b/integrations/llama_cpp/tests/test_chat_generator.py @@ -10,7 +10,6 @@ from haystack.components.retrievers.in_memory import InMemoryBM25Retriever from haystack.dataclasses import ChatMessage, ChatRole from haystack.document_stores.in_memory import InMemoryDocumentStore - from haystack_integrations.components.generators.llama_cpp.chat.chat_generator import ( LlamaCppChatGenerator, _convert_message_to_llamacpp_format, diff --git a/integrations/llama_cpp/tests/test_generator.py b/integrations/llama_cpp/tests/test_generator.py index f57de94b1..04b8339e5 100644 --- a/integrations/llama_cpp/tests/test_generator.py +++ b/integrations/llama_cpp/tests/test_generator.py @@ -9,7 +9,6 @@ from haystack.components.builders.prompt_builder import PromptBuilder from haystack.components.retrievers.in_memory import InMemoryBM25Retriever from haystack.document_stores.in_memory import InMemoryDocumentStore - from haystack_integrations.components.generators.llama_cpp import LlamaCppGenerator diff --git a/integrations/mistral/pyproject.toml b/integrations/mistral/pyproject.toml index 3949eb713..016ac8740 100644 --- a/integrations/mistral/pyproject.toml +++ b/integrations/mistral/pyproject.toml @@ -65,10 +65,10 @@ dependencies = ["black>=23.1.0", "mypy>=1.0.0", "ruff>=0.0.243"] [tool.hatch.envs.lint.scripts] typing = "mypy --install-types --non-interactive --explicit-package-bases {args:src/ tests}" style = [ - "ruff check {args:. --exclude tests/}", + "ruff check {args:}", "black --check --diff {args:.}", ] -fmt = ["black {args:.}", "ruff check --fix {args:. --exclude tests/}", "style"] +fmt = ["black {args:.}", "ruff check --fix {args:}", "style"] all = ["style", "typing"] [tool.black] diff --git a/integrations/mongodb_atlas/pyproject.toml b/integrations/mongodb_atlas/pyproject.toml index d177c0524..d1145b3de 100644 --- a/integrations/mongodb_atlas/pyproject.toml +++ b/integrations/mongodb_atlas/pyproject.toml @@ -66,8 +66,8 @@ detached = true dependencies = ["black>=23.1.0", "mypy>=1.0.0", "ruff>=0.0.243"] [tool.hatch.envs.lint.scripts] typing = "mypy --install-types --non-interactive --explicit-package-bases {args:src/ tests}" -style = ["ruff check {args:. --exclude tests/, examples/}", "black --check --diff {args:.}"] -fmt = ["black {args:.}", "ruff check --fix {args:. --exclude tests/, examples/}", "style"] +style = ["ruff check {args:.}", "black --check --diff {args:.}"] +fmt = ["black {args:.}", "ruff check --fix {args:.}", "style"] all = ["style", "typing"] [tool.black] diff --git a/integrations/nvidia/pyproject.toml b/integrations/nvidia/pyproject.toml index 9f4363eb4..de7fa9ea0 100644 --- a/integrations/nvidia/pyproject.toml +++ b/integrations/nvidia/pyproject.toml @@ -67,10 +67,10 @@ dependencies = ["black>=23.1.0", "mypy>=1.0.0", "ruff>=0.0.243"] [tool.hatch.envs.lint.scripts] typing = "mypy --install-types --non-interactive --explicit-package-bases {args:src/ tests}" style = [ - "ruff check {args:. --exclude tests/}", + "ruff check {args:}", "black --check --diff {args:.}", ] -fmt = ["black {args:.}", "ruff check --fix {args:. --exclude tests/}", "style"] +fmt = ["black {args:.}", "ruff check --fix {args:}", "style"] all = ["style", "typing"] [tool.black] diff --git a/integrations/opensearch/pyproject.toml b/integrations/opensearch/pyproject.toml index bdf251a2e..ffc736755 100644 --- a/integrations/opensearch/pyproject.toml +++ b/integrations/opensearch/pyproject.toml @@ -67,8 +67,8 @@ detached = true dependencies = ["black>=23.1.0", "mypy>=1.0.0", "ruff>=0.0.243", "boto3"] [tool.hatch.envs.lint.scripts] typing = "mypy --install-types --non-interactive --explicit-package-bases {args:src/ tests}" -style = ["ruff check {args:. --exclude tests/}", "black --check --diff {args:.}"] -fmt = ["black {args:.}", "ruff check --fix {args:. --exclude tests/}", "style"] +style = ["ruff check {args:}", "black --check --diff {args:.}"] +fmt = ["black {args:.}", "ruff check --fix {args:}", "style"] all = ["style", "typing"] [tool.hatch.metadata] diff --git a/integrations/opensearch/tests/test_auth.py b/integrations/opensearch/tests/test_auth.py index a413b9b56..25bda7d66 100644 --- a/integrations/opensearch/tests/test_auth.py +++ b/integrations/opensearch/tests/test_auth.py @@ -1,9 +1,8 @@ from unittest.mock import Mock, patch import pytest -from opensearchpy import Urllib3AWSV4SignerAuth - from haystack_integrations.document_stores.opensearch.auth import AWSAuth +from opensearchpy import Urllib3AWSV4SignerAuth class TestAWSAuth: diff --git a/integrations/opensearch/tests/test_bm25_retriever.py b/integrations/opensearch/tests/test_bm25_retriever.py index ef3275608..c015d360a 100644 --- a/integrations/opensearch/tests/test_bm25_retriever.py +++ b/integrations/opensearch/tests/test_bm25_retriever.py @@ -6,7 +6,6 @@ import pytest from haystack.dataclasses import Document from haystack.document_stores.types import FilterPolicy - from haystack_integrations.components.retrievers.opensearch import OpenSearchBM25Retriever from haystack_integrations.document_stores.opensearch import OpenSearchDocumentStore from haystack_integrations.document_stores.opensearch.document_store import DEFAULT_MAX_CHUNK_BYTES diff --git a/integrations/opensearch/tests/test_document_store.py b/integrations/opensearch/tests/test_document_store.py index 9cc4bf4ea..df7ccee78 100644 --- a/integrations/opensearch/tests/test_document_store.py +++ b/integrations/opensearch/tests/test_document_store.py @@ -11,11 +11,10 @@ from haystack.document_stores.types import DuplicatePolicy from haystack.testing.document_store import DocumentStoreBaseTests from haystack.utils.auth import Secret -from opensearchpy.exceptions import RequestError - from haystack_integrations.document_stores.opensearch import OpenSearchDocumentStore from haystack_integrations.document_stores.opensearch.auth import AWSAuth from haystack_integrations.document_stores.opensearch.document_store import DEFAULT_MAX_CHUNK_BYTES +from opensearchpy.exceptions import RequestError @patch("haystack_integrations.document_stores.opensearch.document_store.OpenSearch") diff --git a/integrations/opensearch/tests/test_embedding_retriever.py b/integrations/opensearch/tests/test_embedding_retriever.py index 75c191946..e52a099c8 100644 --- a/integrations/opensearch/tests/test_embedding_retriever.py +++ b/integrations/opensearch/tests/test_embedding_retriever.py @@ -6,7 +6,6 @@ import pytest from haystack.dataclasses import Document from haystack.document_stores.types import FilterPolicy - from haystack_integrations.components.retrievers.opensearch import OpenSearchEmbeddingRetriever from haystack_integrations.document_stores.opensearch import OpenSearchDocumentStore from haystack_integrations.document_stores.opensearch.document_store import DEFAULT_MAX_CHUNK_BYTES diff --git a/integrations/opensearch/tests/test_filters.py b/integrations/opensearch/tests/test_filters.py index 966d0d363..d333dc584 100644 --- a/integrations/opensearch/tests/test_filters.py +++ b/integrations/opensearch/tests/test_filters.py @@ -3,7 +3,6 @@ # SPDX-License-Identifier: Apache-2.0 import pytest from haystack.errors import FilterError - from haystack_integrations.document_stores.opensearch.filters import _normalize_ranges, normalize_filters filters_data = [ diff --git a/integrations/pgvector/pyproject.toml b/integrations/pgvector/pyproject.toml index a9c47d3bd..cd1c69189 100644 --- a/integrations/pgvector/pyproject.toml +++ b/integrations/pgvector/pyproject.toml @@ -66,8 +66,8 @@ detached = true dependencies = ["black>=23.1.0", "mypy>=1.0.0", "ruff>=0.0.243"] [tool.hatch.envs.lint.scripts] typing = "mypy --install-types --non-interactive --explicit-package-bases {args:src/ tests}" -style = ["ruff check {args:. --exclude tests/, examples/}", "black --check --diff {args:.}"] -fmt = ["black {args:.}", "ruff check --fix {args:. --exclude tests/, examples/}", "style"] +style = ["ruff check {args:.}", "black --check --diff {args:.}"] +fmt = ["black {args:.}", "ruff check --fix {args:.}", "style"] all = ["style", "typing"] [tool.black] diff --git a/integrations/pgvector/tests/conftest.py b/integrations/pgvector/tests/conftest.py index 0c3d27088..b53589763 100644 --- a/integrations/pgvector/tests/conftest.py +++ b/integrations/pgvector/tests/conftest.py @@ -2,7 +2,6 @@ from unittest.mock import patch import pytest - from haystack_integrations.document_stores.pgvector import PgvectorDocumentStore diff --git a/integrations/pgvector/tests/test_document_store.py b/integrations/pgvector/tests/test_document_store.py index 93514b71c..eca8190ee 100644 --- a/integrations/pgvector/tests/test_document_store.py +++ b/integrations/pgvector/tests/test_document_store.py @@ -11,9 +11,8 @@ from haystack.document_stores.types import DuplicatePolicy from haystack.testing.document_store import CountDocumentsTest, DeleteDocumentsTest, WriteDocumentsTest from haystack.utils import Secret -from pandas import DataFrame - from haystack_integrations.document_stores.pgvector import PgvectorDocumentStore +from pandas import DataFrame @pytest.mark.integration diff --git a/integrations/pgvector/tests/test_embedding_retrieval.py b/integrations/pgvector/tests/test_embedding_retrieval.py index 46add79e1..2c384f57c 100644 --- a/integrations/pgvector/tests/test_embedding_retrieval.py +++ b/integrations/pgvector/tests/test_embedding_retrieval.py @@ -6,9 +6,8 @@ import pytest from haystack.dataclasses.document import Document -from numpy.random import rand - from haystack_integrations.document_stores.pgvector import PgvectorDocumentStore +from numpy.random import rand @pytest.mark.integration diff --git a/integrations/pgvector/tests/test_filters.py b/integrations/pgvector/tests/test_filters.py index 08e693471..bda10e3c0 100644 --- a/integrations/pgvector/tests/test_filters.py +++ b/integrations/pgvector/tests/test_filters.py @@ -3,10 +3,6 @@ import pytest from haystack.dataclasses.document import Document from haystack.testing.document_store import FilterDocumentsTest -from pandas import DataFrame -from psycopg.sql import SQL -from psycopg.types.json import Jsonb - from haystack_integrations.document_stores.pgvector.filters import ( FilterError, _convert_filters_to_where_clause_and_params, @@ -14,6 +10,9 @@ _parse_logical_condition, _treat_meta_field, ) +from pandas import DataFrame +from psycopg.sql import SQL +from psycopg.types.json import Jsonb @pytest.mark.integration diff --git a/integrations/pgvector/tests/test_keyword_retrieval.py b/integrations/pgvector/tests/test_keyword_retrieval.py index 859a61a5f..4a5614165 100644 --- a/integrations/pgvector/tests/test_keyword_retrieval.py +++ b/integrations/pgvector/tests/test_keyword_retrieval.py @@ -1,6 +1,5 @@ import pytest from haystack.dataclasses.document import Document - from haystack_integrations.document_stores.pgvector import PgvectorDocumentStore diff --git a/integrations/pgvector/tests/test_retrievers.py b/integrations/pgvector/tests/test_retrievers.py index 290891307..058c435ca 100644 --- a/integrations/pgvector/tests/test_retrievers.py +++ b/integrations/pgvector/tests/test_retrievers.py @@ -7,7 +7,6 @@ from haystack.dataclasses import Document from haystack.document_stores.types import FilterPolicy from haystack.utils.auth import EnvVarSecret - from haystack_integrations.components.retrievers.pgvector import PgvectorEmbeddingRetriever, PgvectorKeywordRetriever from haystack_integrations.document_stores.pgvector import PgvectorDocumentStore diff --git a/integrations/qdrant/pyproject.toml b/integrations/qdrant/pyproject.toml index 59dacc36c..898fd2dcf 100644 --- a/integrations/qdrant/pyproject.toml +++ b/integrations/qdrant/pyproject.toml @@ -62,8 +62,8 @@ detached = true dependencies = ["black>=23.1.0", "mypy>=1.0.0", "ruff>=0.0.243"] [tool.hatch.envs.lint.scripts] typing = "mypy --install-types --non-interactive --explicit-package-bases {args:src/ tests}" -style = ["ruff check {args:. --exclude tests/, examples/}", "black --check --diff {args:.}"] -fmt = ["black {args:.}", "ruff check --fix {args:. --exclude tests/, examples/}", "style"] +style = ["ruff check {args:.}", "black --check --diff {args:.}"] +fmt = ["black {args:.}", "ruff check --fix {args:.}", "style"] all = ["style", "typing"] [tool.black] diff --git a/integrations/qdrant/tests/test_converters.py b/integrations/qdrant/tests/test_converters.py index 566da49ab..242c4cafe 100644 --- a/integrations/qdrant/tests/test_converters.py +++ b/integrations/qdrant/tests/test_converters.py @@ -1,10 +1,9 @@ import numpy as np -from qdrant_client.http import models as rest - from haystack_integrations.document_stores.qdrant.converters import ( convert_id, convert_qdrant_point_to_haystack_document, ) +from qdrant_client.http import models as rest def test_convert_id_is_deterministic(): diff --git a/integrations/qdrant/tests/test_dict_converters.py b/integrations/qdrant/tests/test_dict_converters.py index 8ea5b5595..3871dbff0 100644 --- a/integrations/qdrant/tests/test_dict_converters.py +++ b/integrations/qdrant/tests/test_dict_converters.py @@ -1,5 +1,4 @@ from haystack.utils import Secret - from haystack_integrations.document_stores.qdrant import QdrantDocumentStore diff --git a/integrations/qdrant/tests/test_document_store.py b/integrations/qdrant/tests/test_document_store.py index 79523531b..fc777e4c7 100644 --- a/integrations/qdrant/tests/test_document_store.py +++ b/integrations/qdrant/tests/test_document_store.py @@ -12,13 +12,12 @@ WriteDocumentsTest, _random_embeddings, ) -from qdrant_client.http import models as rest - from haystack_integrations.document_stores.qdrant.document_store import ( SPARSE_VECTORS_NAME, QdrantDocumentStore, QdrantStoreError, ) +from qdrant_client.http import models as rest class TestQdrantDocumentStore(CountDocumentsTest, WriteDocumentsTest, DeleteDocumentsTest): diff --git a/integrations/qdrant/tests/test_filters.py b/integrations/qdrant/tests/test_filters.py index 1afd2b7f3..fd070bda9 100644 --- a/integrations/qdrant/tests/test_filters.py +++ b/integrations/qdrant/tests/test_filters.py @@ -4,9 +4,8 @@ from haystack import Document from haystack.testing.document_store import FilterDocumentsTest from haystack.utils.filters import FilterError -from qdrant_client.http import models - from haystack_integrations.document_stores.qdrant import QdrantDocumentStore +from qdrant_client.http import models class TestQdrantStoreBaseTests(FilterDocumentsTest): diff --git a/integrations/qdrant/tests/test_retriever.py b/integrations/qdrant/tests/test_retriever.py index bd6b92842..426423d5d 100644 --- a/integrations/qdrant/tests/test_retriever.py +++ b/integrations/qdrant/tests/test_retriever.py @@ -8,7 +8,6 @@ FilterableDocsFixtureMixin, _random_embeddings, ) - from haystack_integrations.components.retrievers.qdrant import ( QdrantEmbeddingRetriever, QdrantHybridRetriever, diff --git a/integrations/snowflake/pyproject.toml b/integrations/snowflake/pyproject.toml index f5e87e334..fe7a18ec6 100644 --- a/integrations/snowflake/pyproject.toml +++ b/integrations/snowflake/pyproject.toml @@ -62,8 +62,8 @@ detached = true dependencies = ["black>=23.1.0", "mypy>=1.0.0", "ruff>=0.0.243"] [tool.hatch.envs.lint.scripts] typing = "mypy --install-types --non-interactive --explicit-package-bases {args:src/ tests}" -style = ["ruff check {args:. --exclude tests/}", "black --check --diff {args:.}"] -fmt = ["black {args:.}", "ruff check --fix {args:. --exclude tests/}", "style"] +style = ["ruff check {args:}", "black --check --diff {args:.}"] +fmt = ["black {args:.}", "ruff check --fix {args:}", "style"] all = ["style", "typing"] [tool.black] diff --git a/integrations/snowflake/tests/test_snowflake_table_retriever.py b/integrations/snowflake/tests/test_snowflake_table_retriever.py index c68e96c1f..f0fc3b99f 100644 --- a/integrations/snowflake/tests/test_snowflake_table_retriever.py +++ b/integrations/snowflake/tests/test_snowflake_table_retriever.py @@ -477,8 +477,10 @@ def test_to_dict_default(self, monkeypatch: MagicMock) -> None: data = component.to_dict() + t = "haystack_integrations.components.retrievers.snowflake.snowflake_table_retriever.SnowflakeTableRetriever" + assert data == { - "type": "haystack_integrations.components.retrievers.snowflake.snowflake_table_retriever.SnowflakeTableRetriever", + "type": t, "init_parameters": { "api_key": { "env_vars": ["SNOWFLAKE_API_KEY"], @@ -509,8 +511,10 @@ def test_to_dict_with_parameters(self, monkeypatch: MagicMock) -> None: data = component.to_dict() + t = "haystack_integrations.components.retrievers.snowflake.snowflake_table_retriever.SnowflakeTableRetriever" + assert data == { - "type": "haystack_integrations.components.retrievers.snowflake.snowflake_table_retriever.SnowflakeTableRetriever", + "type": t, "init_parameters": { "api_key": { "env_vars": ["SNOWFLAKE_API_KEY"], diff --git a/integrations/unstructured/pyproject.toml b/integrations/unstructured/pyproject.toml index ba4d700c6..218a51711 100644 --- a/integrations/unstructured/pyproject.toml +++ b/integrations/unstructured/pyproject.toml @@ -65,10 +65,10 @@ dependencies = ["black>=23.1.0", "mypy>=1.0.0", "ruff>=0.0.243"] [tool.hatch.envs.lint.scripts] typing = "mypy --install-types --non-interactive --explicit-package-bases {args:src/ tests}" style = [ - "ruff check {args:. --exclude tests/}", + "ruff check {args:}", "black --check --diff {args:.}", ] -fmt = ["black {args:.}", "ruff check --fix {args:. --exclude tests/}", "style"] +fmt = ["black {args:.}", "ruff check --fix {args:}", "style"] all = ["style", "typing"] [tool.hatch.metadata] diff --git a/integrations/unstructured/tests/test_converter.py b/integrations/unstructured/tests/test_converter.py index 063289b07..5d1a6c091 100644 --- a/integrations/unstructured/tests/test_converter.py +++ b/integrations/unstructured/tests/test_converter.py @@ -2,7 +2,6 @@ # # SPDX-License-Identifier: Apache-2.0 import pytest - from haystack_integrations.components.converters.unstructured import UnstructuredFileConverter diff --git a/integrations/weaviate/pyproject.toml b/integrations/weaviate/pyproject.toml index 06546492e..075422ba0 100644 --- a/integrations/weaviate/pyproject.toml +++ b/integrations/weaviate/pyproject.toml @@ -65,8 +65,8 @@ detached = true dependencies = ["black>=23.1.0", "mypy>=1.0.0", "ruff>=0.0.243"] [tool.hatch.envs.lint.scripts] typing = "mypy --install-types --non-interactive --explicit-package-bases {args:src/ tests}" -style = ["ruff check {args:. --exclude tests/}", "black --check --diff {args:.}"] -fmt = ["black {args:.}", "ruff check --fix {args:. --exclude tests/}", "style"] +style = ["ruff check {args:}", "black --check --diff {args:.}"] +fmt = ["black {args:.}", "ruff check --fix {args:}", "style"] all = ["style", "typing"] [tool.black] From 28adb9fc2aac164da9ebf1f38eb2c4c515693235 Mon Sep 17 00:00:00 2001 From: anakin87 Date: Wed, 25 Sep 2024 19:20:09 +0200 Subject: [PATCH 4/8] more changes --- integrations/chroma/pyproject.toml | 2 +- integrations/cohere/examples/cohere_embedding.py | 1 + integrations/cohere/examples/cohere_generation.py | 1 + integrations/cohere/examples/cohere_ranker.py | 1 + integrations/cohere/pyproject.toml | 4 ++-- .../components/embedders/cohere/document_embedder.py | 2 +- .../components/embedders/cohere/text_embedder.py | 2 +- integrations/cohere/tests/test_cohere_chat_generator.py | 1 + integrations/cohere/tests/test_cohere_generator.py | 1 + integrations/cohere/tests/test_cohere_ranker.py | 1 + integrations/cohere/tests/test_document_embedder.py | 1 + integrations/cohere/tests/test_text_embedder.py | 1 + integrations/deepeval/pyproject.toml | 2 +- integrations/elasticsearch/pyproject.toml | 2 +- .../components/retrievers/elasticsearch/bm25_retriever.py | 1 + .../retrievers/elasticsearch/embedding_retriever.py | 1 + integrations/elasticsearch/tests/test_bm25_retriever.py | 1 + integrations/elasticsearch/tests/test_document_store.py | 1 + .../elasticsearch/tests/test_embedding_retriever.py | 1 + integrations/elasticsearch/tests/test_filters.py | 1 + integrations/fastembed/examples/example.py | 1 + integrations/fastembed/examples/sparse_example.py | 1 + integrations/fastembed/pyproject.toml | 2 +- .../fastembed/tests/test_fastembed_document_embedder.py | 1 + .../tests/test_fastembed_sparse_document_embedder.py | 1 + .../fastembed/tests/test_fastembed_sparse_text_embedder.py | 1 + .../fastembed/tests/test_fastembed_text_embedder.py | 1 + integrations/jina/pyproject.toml | 2 +- integrations/jina/tests/test_document_embedder.py | 1 + integrations/jina/tests/test_ranker.py | 1 + integrations/jina/tests/test_text_embedder.py | 1 + integrations/langfuse/pyproject.toml | 2 +- integrations/llama_cpp/examples/rag_pipeline_example.py | 1 + integrations/llama_cpp/pyproject.toml | 2 +- integrations/llama_cpp/tests/test_chat_generator.py | 1 + integrations/llama_cpp/tests/test_generator.py | 1 + integrations/mistral/pyproject.toml | 2 +- integrations/mongodb_atlas/pyproject.toml | 2 +- integrations/nvidia/pyproject.toml | 2 +- integrations/ollama/pyproject.toml | 2 +- integrations/opensearch/pyproject.toml | 2 +- .../components/retrievers/opensearch/bm25_retriever.py | 1 + .../retrievers/opensearch/embedding_retriever.py | 1 + .../document_stores/opensearch/document_store.py | 5 +++-- integrations/opensearch/tests/test_auth.py | 3 ++- integrations/opensearch/tests/test_bm25_retriever.py | 1 + integrations/opensearch/tests/test_document_store.py | 3 ++- integrations/opensearch/tests/test_embedding_retriever.py | 1 + integrations/opensearch/tests/test_filters.py | 1 + integrations/optimum/pyproject.toml | 2 +- integrations/pgvector/examples/embedding_retrieval.py | 1 + integrations/pgvector/examples/hybrid_retrieval.py | 1 + integrations/pgvector/pyproject.toml | 2 +- .../components/retrievers/pgvector/embedding_retriever.py | 1 + .../components/retrievers/pgvector/keyword_retriever.py | 1 + integrations/pgvector/tests/conftest.py | 1 + integrations/pgvector/tests/test_document_store.py | 3 ++- integrations/pgvector/tests/test_embedding_retrieval.py | 3 ++- integrations/pgvector/tests/test_filters.py | 7 ++++--- integrations/pgvector/tests/test_keyword_retrieval.py | 1 + integrations/pgvector/tests/test_retrievers.py | 1 + integrations/ragas/pyproject.toml | 2 +- integrations/snowflake/pyproject.toml | 2 +- integrations/unstructured/pyproject.toml | 2 +- integrations/unstructured/tests/test_converter.py | 1 + integrations/weaviate/pyproject.toml | 2 +- 66 files changed, 76 insertions(+), 31 deletions(-) diff --git a/integrations/chroma/pyproject.toml b/integrations/chroma/pyproject.toml index b2f22677d..2bffabfd8 100644 --- a/integrations/chroma/pyproject.toml +++ b/integrations/chroma/pyproject.toml @@ -139,7 +139,7 @@ unfixable = [ exclude = ["example"] [tool.ruff.lint.isort] -known-first-party = ["src", "example", "tests"] +known-first-party = ["haystack_integrations"] [tool.ruff.lint.flake8-tidy-imports] ban-relative-imports = "parents" diff --git a/integrations/cohere/examples/cohere_embedding.py b/integrations/cohere/examples/cohere_embedding.py index e6fe3cc35..75131de86 100644 --- a/integrations/cohere/examples/cohere_embedding.py +++ b/integrations/cohere/examples/cohere_embedding.py @@ -1,6 +1,7 @@ from haystack import Document, Pipeline from haystack.components.retrievers.in_memory import InMemoryEmbeddingRetriever from haystack.document_stores.in_memory import InMemoryDocumentStore + from haystack_integrations.components.embedders.cohere.document_embedder import CohereDocumentEmbedder from haystack_integrations.components.embedders.cohere.text_embedder import CohereTextEmbedder diff --git a/integrations/cohere/examples/cohere_generation.py b/integrations/cohere/examples/cohere_generation.py index cd79e37d3..3baec6327 100644 --- a/integrations/cohere/examples/cohere_generation.py +++ b/integrations/cohere/examples/cohere_generation.py @@ -20,6 +20,7 @@ from haystack.components.joiners import BranchJoiner from haystack.components.validators import JsonSchemaValidator from haystack.dataclasses import ChatMessage + from haystack_integrations.components.generators.cohere import CohereChatGenerator # Defines a JSON schema for validating a person's data. The schema specifies that a valid object must diff --git a/integrations/cohere/examples/cohere_ranker.py b/integrations/cohere/examples/cohere_ranker.py index 79a3d346d..b66ca1aae 100644 --- a/integrations/cohere/examples/cohere_ranker.py +++ b/integrations/cohere/examples/cohere_ranker.py @@ -1,6 +1,7 @@ from haystack import Document, Pipeline from haystack.components.retrievers.in_memory import InMemoryBM25Retriever from haystack.document_stores.in_memory import InMemoryDocumentStore + from haystack_integrations.components.rankers.cohere import CohereRanker # Note set your API key by running the below command in your terminal diff --git a/integrations/cohere/pyproject.toml b/integrations/cohere/pyproject.toml index 63e736de6..d86165668 100644 --- a/integrations/cohere/pyproject.toml +++ b/integrations/cohere/pyproject.toml @@ -65,7 +65,7 @@ dependencies = ["black>=23.1.0", "mypy>=1.0.0", "ruff>=0.0.243"] [tool.hatch.envs.lint.scripts] typing = "mypy --install-types --non-interactive --explicit-package-bases {args:src/ tests}" style = [ - "ruff check {args:}", + "ruff check {args:.}", "black --check --diff {args:.}", ] fmt = ["black {args:.}", "ruff check --fix {args:}", "style"] @@ -130,7 +130,7 @@ unfixable = [ ] [tool.ruff.lint.isort] -known-first-party = ["src"] +known-first-party = ["haystack_integrations"] [tool.ruff.lint.flake8-tidy-imports] ban-relative-imports = "parents" diff --git a/integrations/cohere/src/haystack_integrations/components/embedders/cohere/document_embedder.py b/integrations/cohere/src/haystack_integrations/components/embedders/cohere/document_embedder.py index 59a04cf3c..3201168a8 100644 --- a/integrations/cohere/src/haystack_integrations/components/embedders/cohere/document_embedder.py +++ b/integrations/cohere/src/haystack_integrations/components/embedders/cohere/document_embedder.py @@ -6,9 +6,9 @@ from haystack import Document, component, default_from_dict, default_to_dict from haystack.utils import Secret, deserialize_secrets_inplace -from haystack_integrations.components.embedders.cohere.utils import get_async_response, get_response from cohere import AsyncClient, Client +from haystack_integrations.components.embedders.cohere.utils import get_async_response, get_response @component diff --git a/integrations/cohere/src/haystack_integrations/components/embedders/cohere/text_embedder.py b/integrations/cohere/src/haystack_integrations/components/embedders/cohere/text_embedder.py index 80ede51bf..c1e9bd613 100644 --- a/integrations/cohere/src/haystack_integrations/components/embedders/cohere/text_embedder.py +++ b/integrations/cohere/src/haystack_integrations/components/embedders/cohere/text_embedder.py @@ -6,9 +6,9 @@ from haystack import component, default_from_dict, default_to_dict from haystack.utils import Secret, deserialize_secrets_inplace -from haystack_integrations.components.embedders.cohere.utils import get_async_response, get_response from cohere import AsyncClient, Client +from haystack_integrations.components.embedders.cohere.utils import get_async_response, get_response @component diff --git a/integrations/cohere/tests/test_cohere_chat_generator.py b/integrations/cohere/tests/test_cohere_chat_generator.py index fe9b7f43e..175a6d14b 100644 --- a/integrations/cohere/tests/test_cohere_chat_generator.py +++ b/integrations/cohere/tests/test_cohere_chat_generator.py @@ -7,6 +7,7 @@ from haystack.components.generators.utils import print_streaming_chunk from haystack.dataclasses import ChatMessage, ChatRole, StreamingChunk from haystack.utils import Secret + from haystack_integrations.components.generators.cohere import CohereChatGenerator pytestmark = pytest.mark.chat_generators diff --git a/integrations/cohere/tests/test_cohere_generator.py b/integrations/cohere/tests/test_cohere_generator.py index 736b6bfbf..60ee6ac93 100644 --- a/integrations/cohere/tests/test_cohere_generator.py +++ b/integrations/cohere/tests/test_cohere_generator.py @@ -7,6 +7,7 @@ from cohere.core import ApiError from haystack.components.generators.utils import print_streaming_chunk from haystack.utils import Secret + from haystack_integrations.components.generators.cohere import CohereGenerator pytestmark = pytest.mark.generators diff --git a/integrations/cohere/tests/test_cohere_ranker.py b/integrations/cohere/tests/test_cohere_ranker.py index 670e662d4..ff861b39d 100644 --- a/integrations/cohere/tests/test_cohere_ranker.py +++ b/integrations/cohere/tests/test_cohere_ranker.py @@ -4,6 +4,7 @@ import pytest from haystack import Document from haystack.utils.auth import Secret + from haystack_integrations.components.rankers.cohere import CohereRanker pytestmark = pytest.mark.ranker diff --git a/integrations/cohere/tests/test_document_embedder.py b/integrations/cohere/tests/test_document_embedder.py index ffbf280e9..d69e1a5a2 100644 --- a/integrations/cohere/tests/test_document_embedder.py +++ b/integrations/cohere/tests/test_document_embedder.py @@ -6,6 +6,7 @@ import pytest from haystack import Document from haystack.utils import Secret + from haystack_integrations.components.embedders.cohere import CohereDocumentEmbedder pytestmark = pytest.mark.embedders diff --git a/integrations/cohere/tests/test_text_embedder.py b/integrations/cohere/tests/test_text_embedder.py index b4f3e234c..80f7c1a3e 100644 --- a/integrations/cohere/tests/test_text_embedder.py +++ b/integrations/cohere/tests/test_text_embedder.py @@ -5,6 +5,7 @@ import pytest from haystack.utils import Secret + from haystack_integrations.components.embedders.cohere import CohereTextEmbedder pytestmark = pytest.mark.embedders diff --git a/integrations/deepeval/pyproject.toml b/integrations/deepeval/pyproject.toml index f421b514a..3e22053c6 100644 --- a/integrations/deepeval/pyproject.toml +++ b/integrations/deepeval/pyproject.toml @@ -126,7 +126,7 @@ unfixable = [ ] [tool.ruff.lint.isort] -known-first-party = ["src"] +known-first-party = ["haystack_integrations"] [tool.ruff.lint.flake8-tidy-imports] ban-relative-imports = "all" diff --git a/integrations/elasticsearch/pyproject.toml b/integrations/elasticsearch/pyproject.toml index 9cc3aba37..47b168f30 100644 --- a/integrations/elasticsearch/pyproject.toml +++ b/integrations/elasticsearch/pyproject.toml @@ -131,7 +131,7 @@ unfixable = [ ] [tool.ruff.lint.isort] -known-first-party = ["src"] +known-first-party = ["haystack_integrations"] [tool.ruff.lint.flake8-tidy-imports] ban-relative-imports = "parents" diff --git a/integrations/elasticsearch/src/haystack_integrations/components/retrievers/elasticsearch/bm25_retriever.py b/integrations/elasticsearch/src/haystack_integrations/components/retrievers/elasticsearch/bm25_retriever.py index f273c955b..c25bd1e81 100644 --- a/integrations/elasticsearch/src/haystack_integrations/components/retrievers/elasticsearch/bm25_retriever.py +++ b/integrations/elasticsearch/src/haystack_integrations/components/retrievers/elasticsearch/bm25_retriever.py @@ -7,6 +7,7 @@ from haystack.dataclasses import Document from haystack.document_stores.types import FilterPolicy from haystack.document_stores.types.filter_policy import apply_filter_policy + from haystack_integrations.document_stores.elasticsearch.document_store import ElasticsearchDocumentStore diff --git a/integrations/elasticsearch/src/haystack_integrations/components/retrievers/elasticsearch/embedding_retriever.py b/integrations/elasticsearch/src/haystack_integrations/components/retrievers/elasticsearch/embedding_retriever.py index 10e860ea4..b8cebc544 100644 --- a/integrations/elasticsearch/src/haystack_integrations/components/retrievers/elasticsearch/embedding_retriever.py +++ b/integrations/elasticsearch/src/haystack_integrations/components/retrievers/elasticsearch/embedding_retriever.py @@ -7,6 +7,7 @@ from haystack.dataclasses import Document from haystack.document_stores.types import FilterPolicy from haystack.document_stores.types.filter_policy import apply_filter_policy + from haystack_integrations.document_stores.elasticsearch.document_store import ElasticsearchDocumentStore diff --git a/integrations/elasticsearch/tests/test_bm25_retriever.py b/integrations/elasticsearch/tests/test_bm25_retriever.py index 3e9ebc9b8..c306c00b7 100644 --- a/integrations/elasticsearch/tests/test_bm25_retriever.py +++ b/integrations/elasticsearch/tests/test_bm25_retriever.py @@ -6,6 +6,7 @@ import pytest from haystack.dataclasses import Document from haystack.document_stores.types import FilterPolicy + from haystack_integrations.components.retrievers.elasticsearch import ElasticsearchBM25Retriever from haystack_integrations.document_stores.elasticsearch import ElasticsearchDocumentStore diff --git a/integrations/elasticsearch/tests/test_document_store.py b/integrations/elasticsearch/tests/test_document_store.py index 20b68f126..51a19b641 100644 --- a/integrations/elasticsearch/tests/test_document_store.py +++ b/integrations/elasticsearch/tests/test_document_store.py @@ -12,6 +12,7 @@ from haystack.document_stores.errors import DocumentStoreError, DuplicateDocumentError from haystack.document_stores.types import DuplicatePolicy from haystack.testing.document_store import DocumentStoreBaseTests + from haystack_integrations.document_stores.elasticsearch import ElasticsearchDocumentStore diff --git a/integrations/elasticsearch/tests/test_embedding_retriever.py b/integrations/elasticsearch/tests/test_embedding_retriever.py index 2d03f0ec2..0725548bf 100644 --- a/integrations/elasticsearch/tests/test_embedding_retriever.py +++ b/integrations/elasticsearch/tests/test_embedding_retriever.py @@ -6,6 +6,7 @@ import pytest from haystack.dataclasses import Document from haystack.document_stores.types import FilterPolicy + from haystack_integrations.components.retrievers.elasticsearch import ElasticsearchEmbeddingRetriever from haystack_integrations.document_stores.elasticsearch import ElasticsearchDocumentStore diff --git a/integrations/elasticsearch/tests/test_filters.py b/integrations/elasticsearch/tests/test_filters.py index 86e5cba74..5f09f0a49 100644 --- a/integrations/elasticsearch/tests/test_filters.py +++ b/integrations/elasticsearch/tests/test_filters.py @@ -3,6 +3,7 @@ # SPDX-License-Identifier: Apache-2.0 import pytest from haystack.errors import FilterError + from haystack_integrations.document_stores.elasticsearch.filters import _normalize_filters, _normalize_ranges filters_data = [ diff --git a/integrations/fastembed/examples/example.py b/integrations/fastembed/examples/example.py index e4d328210..640abd33b 100644 --- a/integrations/fastembed/examples/example.py +++ b/integrations/fastembed/examples/example.py @@ -1,6 +1,7 @@ from haystack import Document, Pipeline from haystack.components.retrievers.in_memory import InMemoryEmbeddingRetriever from haystack.document_stores.in_memory import InMemoryDocumentStore + from haystack_integrations.components.embedders.fastembed import FastembedDocumentEmbedder, FastembedTextEmbedder document_store = InMemoryDocumentStore(embedding_similarity_function="cosine") diff --git a/integrations/fastembed/examples/sparse_example.py b/integrations/fastembed/examples/sparse_example.py index bce3b363d..206788f18 100644 --- a/integrations/fastembed/examples/sparse_example.py +++ b/integrations/fastembed/examples/sparse_example.py @@ -4,6 +4,7 @@ # involving indexing and retrieval of documents. from haystack import Document + from haystack_integrations.components.embedders.fastembed import FastembedSparseDocumentEmbedder document_list = [ diff --git a/integrations/fastembed/pyproject.toml b/integrations/fastembed/pyproject.toml index 545d8d543..69aba5562 100644 --- a/integrations/fastembed/pyproject.toml +++ b/integrations/fastembed/pyproject.toml @@ -131,7 +131,7 @@ unfixable = [ ] [tool.ruff.lint.isort] -known-first-party = ["src"] +known-first-party = ["haystack_integrations"] [tool.ruff.lint.flake8-tidy-imports] ban-relative-imports = "parents" diff --git a/integrations/fastembed/tests/test_fastembed_document_embedder.py b/integrations/fastembed/tests/test_fastembed_document_embedder.py index 8afb89c69..8a7589de1 100644 --- a/integrations/fastembed/tests/test_fastembed_document_embedder.py +++ b/integrations/fastembed/tests/test_fastembed_document_embedder.py @@ -3,6 +3,7 @@ import numpy as np import pytest from haystack import Document, default_from_dict + from haystack_integrations.components.embedders.fastembed.fastembed_document_embedder import ( FastembedDocumentEmbedder, ) diff --git a/integrations/fastembed/tests/test_fastembed_sparse_document_embedder.py b/integrations/fastembed/tests/test_fastembed_sparse_document_embedder.py index b4caca364..d3f2023b8 100644 --- a/integrations/fastembed/tests/test_fastembed_sparse_document_embedder.py +++ b/integrations/fastembed/tests/test_fastembed_sparse_document_embedder.py @@ -4,6 +4,7 @@ import pytest from haystack import Document, default_from_dict from haystack.dataclasses.sparse_embedding import SparseEmbedding + from haystack_integrations.components.embedders.fastembed.fastembed_sparse_document_embedder import ( FastembedSparseDocumentEmbedder, ) diff --git a/integrations/fastembed/tests/test_fastembed_sparse_text_embedder.py b/integrations/fastembed/tests/test_fastembed_sparse_text_embedder.py index 9e37df409..7e9197493 100644 --- a/integrations/fastembed/tests/test_fastembed_sparse_text_embedder.py +++ b/integrations/fastembed/tests/test_fastembed_sparse_text_embedder.py @@ -4,6 +4,7 @@ import pytest from haystack import default_from_dict from haystack.dataclasses.sparse_embedding import SparseEmbedding + from haystack_integrations.components.embedders.fastembed.fastembed_sparse_text_embedder import ( FastembedSparseTextEmbedder, ) diff --git a/integrations/fastembed/tests/test_fastembed_text_embedder.py b/integrations/fastembed/tests/test_fastembed_text_embedder.py index f20a98b57..f1b2e21e9 100644 --- a/integrations/fastembed/tests/test_fastembed_text_embedder.py +++ b/integrations/fastembed/tests/test_fastembed_text_embedder.py @@ -3,6 +3,7 @@ import numpy as np import pytest from haystack import default_from_dict + from haystack_integrations.components.embedders.fastembed.fastembed_text_embedder import ( FastembedTextEmbedder, ) diff --git a/integrations/jina/pyproject.toml b/integrations/jina/pyproject.toml index 9484ec346..cbd8df479 100644 --- a/integrations/jina/pyproject.toml +++ b/integrations/jina/pyproject.toml @@ -122,7 +122,7 @@ unfixable = [ ] [tool.ruff.lint.isort] -known-first-party = ["jina_haystack"] +known-first-party = ["haystack_integrations"] [tool.ruff.lint.flake8-tidy-imports] ban-relative-imports = "parents" diff --git a/integrations/jina/tests/test_document_embedder.py b/integrations/jina/tests/test_document_embedder.py index 02d8fc70e..247b95eff 100644 --- a/integrations/jina/tests/test_document_embedder.py +++ b/integrations/jina/tests/test_document_embedder.py @@ -8,6 +8,7 @@ import requests from haystack import Document from haystack.utils import Secret + from haystack_integrations.components.embedders.jina import JinaDocumentEmbedder diff --git a/integrations/jina/tests/test_ranker.py b/integrations/jina/tests/test_ranker.py index 7ece6806d..e7fdaade0 100644 --- a/integrations/jina/tests/test_ranker.py +++ b/integrations/jina/tests/test_ranker.py @@ -8,6 +8,7 @@ import requests from haystack import Document from haystack.utils import Secret + from haystack_integrations.components.rankers.jina import JinaRanker diff --git a/integrations/jina/tests/test_text_embedder.py b/integrations/jina/tests/test_text_embedder.py index a56b2f9ab..058712a18 100644 --- a/integrations/jina/tests/test_text_embedder.py +++ b/integrations/jina/tests/test_text_embedder.py @@ -7,6 +7,7 @@ import pytest import requests from haystack.utils import Secret + from haystack_integrations.components.embedders.jina import JinaTextEmbedder diff --git a/integrations/langfuse/pyproject.toml b/integrations/langfuse/pyproject.toml index 61b8af793..da02b1346 100644 --- a/integrations/langfuse/pyproject.toml +++ b/integrations/langfuse/pyproject.toml @@ -135,7 +135,7 @@ unfixable = [ ] [tool.ruff.lint.isort] -known-first-party = ["src"] +known-first-party = ["haystack_integrations"] [tool.ruff.lint.flake8-tidy-imports] ban-relative-imports = "parents" diff --git a/integrations/llama_cpp/examples/rag_pipeline_example.py b/integrations/llama_cpp/examples/rag_pipeline_example.py index dcab6dbd6..01ee11b98 100644 --- a/integrations/llama_cpp/examples/rag_pipeline_example.py +++ b/integrations/llama_cpp/examples/rag_pipeline_example.py @@ -6,6 +6,7 @@ from haystack.components.retrievers import InMemoryEmbeddingRetriever from haystack.components.writers import DocumentWriter from haystack.document_stores import InMemoryDocumentStore + from haystack_integrations.components.generators.llama_cpp import LlamaCppGenerator # Load first 100 rows of the Simple Wikipedia Dataset from HuggingFace diff --git a/integrations/llama_cpp/pyproject.toml b/integrations/llama_cpp/pyproject.toml index 55fa3ea7b..acf42d958 100644 --- a/integrations/llama_cpp/pyproject.toml +++ b/integrations/llama_cpp/pyproject.toml @@ -78,7 +78,7 @@ all = ["style", "typing"] allow-direct-references = true [tool.ruff.lint.isort] -known-first-party = ["src"] +known-first-party = ["haystack_integrations"] [tool.black] target-version = ["py38"] diff --git a/integrations/llama_cpp/tests/test_chat_generator.py b/integrations/llama_cpp/tests/test_chat_generator.py index 7bd6ef122..1d4c9cf82 100644 --- a/integrations/llama_cpp/tests/test_chat_generator.py +++ b/integrations/llama_cpp/tests/test_chat_generator.py @@ -10,6 +10,7 @@ from haystack.components.retrievers.in_memory import InMemoryBM25Retriever from haystack.dataclasses import ChatMessage, ChatRole from haystack.document_stores.in_memory import InMemoryDocumentStore + from haystack_integrations.components.generators.llama_cpp.chat.chat_generator import ( LlamaCppChatGenerator, _convert_message_to_llamacpp_format, diff --git a/integrations/llama_cpp/tests/test_generator.py b/integrations/llama_cpp/tests/test_generator.py index 04b8339e5..f57de94b1 100644 --- a/integrations/llama_cpp/tests/test_generator.py +++ b/integrations/llama_cpp/tests/test_generator.py @@ -9,6 +9,7 @@ from haystack.components.builders.prompt_builder import PromptBuilder from haystack.components.retrievers.in_memory import InMemoryBM25Retriever from haystack.document_stores.in_memory import InMemoryDocumentStore + from haystack_integrations.components.generators.llama_cpp import LlamaCppGenerator diff --git a/integrations/mistral/pyproject.toml b/integrations/mistral/pyproject.toml index 016ac8740..16f332331 100644 --- a/integrations/mistral/pyproject.toml +++ b/integrations/mistral/pyproject.toml @@ -130,7 +130,7 @@ unfixable = [ ] [tool.ruff.lint.isort] -known-first-party = ["src"] +known-first-party = ["haystack_integrations"] [tool.ruff.lint.flake8-tidy-imports] ban-relative-imports = "parents" diff --git a/integrations/mongodb_atlas/pyproject.toml b/integrations/mongodb_atlas/pyproject.toml index d1145b3de..95ed6c03a 100644 --- a/integrations/mongodb_atlas/pyproject.toml +++ b/integrations/mongodb_atlas/pyproject.toml @@ -129,7 +129,7 @@ unfixable = [ ] [tool.ruff.lint.isort] -known-first-party = ["src"] +known-first-party = ["haystack_integrations"] [tool.ruff.lint.flake8-tidy-imports] ban-relative-imports = "parents" diff --git a/integrations/nvidia/pyproject.toml b/integrations/nvidia/pyproject.toml index de7fa9ea0..b5c6dd205 100644 --- a/integrations/nvidia/pyproject.toml +++ b/integrations/nvidia/pyproject.toml @@ -132,7 +132,7 @@ unfixable = [ ] [tool.ruff.lint.isort] -known-first-party = ["src"] +known-first-party = ["haystack_integrations"] [tool.ruff.lint.flake8-tidy-imports] ban-relative-imports = "parents" diff --git a/integrations/ollama/pyproject.toml b/integrations/ollama/pyproject.toml index f16b4c261..bd01bc149 100644 --- a/integrations/ollama/pyproject.toml +++ b/integrations/ollama/pyproject.toml @@ -79,7 +79,7 @@ all = ["style", "typing"] allow-direct-references = true [tool.ruff.lint.isort] -known-first-party = ["src"] +known-first-party = ["haystack_integrations"] [tool.black] target-version = ["py38"] diff --git a/integrations/opensearch/pyproject.toml b/integrations/opensearch/pyproject.toml index ffc736755..24f1653bd 100644 --- a/integrations/opensearch/pyproject.toml +++ b/integrations/opensearch/pyproject.toml @@ -133,7 +133,7 @@ unfixable = [ ] [tool.ruff.lint.isort] -known-first-party = ["src"] +known-first-party = ["haystack_integrations"] [tool.ruff.lint.flake8-tidy-imports] ban-relative-imports = "parents" diff --git a/integrations/opensearch/src/haystack_integrations/components/retrievers/opensearch/bm25_retriever.py b/integrations/opensearch/src/haystack_integrations/components/retrievers/opensearch/bm25_retriever.py index f09799e85..4a8478e2c 100644 --- a/integrations/opensearch/src/haystack_integrations/components/retrievers/opensearch/bm25_retriever.py +++ b/integrations/opensearch/src/haystack_integrations/components/retrievers/opensearch/bm25_retriever.py @@ -8,6 +8,7 @@ from haystack.dataclasses import Document from haystack.document_stores.types import FilterPolicy from haystack.document_stores.types.filter_policy import apply_filter_policy + from haystack_integrations.document_stores.opensearch import OpenSearchDocumentStore logger = logging.getLogger(__name__) diff --git a/integrations/opensearch/src/haystack_integrations/components/retrievers/opensearch/embedding_retriever.py b/integrations/opensearch/src/haystack_integrations/components/retrievers/opensearch/embedding_retriever.py index 6e2287da3..e159634cf 100644 --- a/integrations/opensearch/src/haystack_integrations/components/retrievers/opensearch/embedding_retriever.py +++ b/integrations/opensearch/src/haystack_integrations/components/retrievers/opensearch/embedding_retriever.py @@ -8,6 +8,7 @@ from haystack.dataclasses import Document from haystack.document_stores.types import FilterPolicy from haystack.document_stores.types.filter_policy import apply_filter_policy + from haystack_integrations.document_stores.opensearch import OpenSearchDocumentStore logger = logging.getLogger(__name__) diff --git a/integrations/opensearch/src/haystack_integrations/document_stores/opensearch/document_store.py b/integrations/opensearch/src/haystack_integrations/document_stores/opensearch/document_store.py index 44bfe65b8..6f7a6c96e 100644 --- a/integrations/opensearch/src/haystack_integrations/document_stores/opensearch/document_store.py +++ b/integrations/opensearch/src/haystack_integrations/document_stores/opensearch/document_store.py @@ -9,11 +9,12 @@ from haystack.dataclasses import Document from haystack.document_stores.errors import DocumentStoreError, DuplicateDocumentError from haystack.document_stores.types import DuplicatePolicy -from haystack_integrations.document_stores.opensearch.auth import AWSAuth -from haystack_integrations.document_stores.opensearch.filters import normalize_filters from opensearchpy import OpenSearch from opensearchpy.helpers import bulk +from haystack_integrations.document_stores.opensearch.auth import AWSAuth +from haystack_integrations.document_stores.opensearch.filters import normalize_filters + logger = logging.getLogger(__name__) Hosts = Union[str, List[Union[str, Mapping[str, Union[str, int]]]]] diff --git a/integrations/opensearch/tests/test_auth.py b/integrations/opensearch/tests/test_auth.py index 25bda7d66..a413b9b56 100644 --- a/integrations/opensearch/tests/test_auth.py +++ b/integrations/opensearch/tests/test_auth.py @@ -1,9 +1,10 @@ from unittest.mock import Mock, patch import pytest -from haystack_integrations.document_stores.opensearch.auth import AWSAuth from opensearchpy import Urllib3AWSV4SignerAuth +from haystack_integrations.document_stores.opensearch.auth import AWSAuth + class TestAWSAuth: @pytest.fixture(autouse=True) diff --git a/integrations/opensearch/tests/test_bm25_retriever.py b/integrations/opensearch/tests/test_bm25_retriever.py index c015d360a..ef3275608 100644 --- a/integrations/opensearch/tests/test_bm25_retriever.py +++ b/integrations/opensearch/tests/test_bm25_retriever.py @@ -6,6 +6,7 @@ import pytest from haystack.dataclasses import Document from haystack.document_stores.types import FilterPolicy + from haystack_integrations.components.retrievers.opensearch import OpenSearchBM25Retriever from haystack_integrations.document_stores.opensearch import OpenSearchDocumentStore from haystack_integrations.document_stores.opensearch.document_store import DEFAULT_MAX_CHUNK_BYTES diff --git a/integrations/opensearch/tests/test_document_store.py b/integrations/opensearch/tests/test_document_store.py index df7ccee78..9cc4bf4ea 100644 --- a/integrations/opensearch/tests/test_document_store.py +++ b/integrations/opensearch/tests/test_document_store.py @@ -11,10 +11,11 @@ from haystack.document_stores.types import DuplicatePolicy from haystack.testing.document_store import DocumentStoreBaseTests from haystack.utils.auth import Secret +from opensearchpy.exceptions import RequestError + from haystack_integrations.document_stores.opensearch import OpenSearchDocumentStore from haystack_integrations.document_stores.opensearch.auth import AWSAuth from haystack_integrations.document_stores.opensearch.document_store import DEFAULT_MAX_CHUNK_BYTES -from opensearchpy.exceptions import RequestError @patch("haystack_integrations.document_stores.opensearch.document_store.OpenSearch") diff --git a/integrations/opensearch/tests/test_embedding_retriever.py b/integrations/opensearch/tests/test_embedding_retriever.py index e52a099c8..75c191946 100644 --- a/integrations/opensearch/tests/test_embedding_retriever.py +++ b/integrations/opensearch/tests/test_embedding_retriever.py @@ -6,6 +6,7 @@ import pytest from haystack.dataclasses import Document from haystack.document_stores.types import FilterPolicy + from haystack_integrations.components.retrievers.opensearch import OpenSearchEmbeddingRetriever from haystack_integrations.document_stores.opensearch import OpenSearchDocumentStore from haystack_integrations.document_stores.opensearch.document_store import DEFAULT_MAX_CHUNK_BYTES diff --git a/integrations/opensearch/tests/test_filters.py b/integrations/opensearch/tests/test_filters.py index d333dc584..966d0d363 100644 --- a/integrations/opensearch/tests/test_filters.py +++ b/integrations/opensearch/tests/test_filters.py @@ -3,6 +3,7 @@ # SPDX-License-Identifier: Apache-2.0 import pytest from haystack.errors import FilterError + from haystack_integrations.document_stores.opensearch.filters import _normalize_ranges, normalize_filters filters_data = [ diff --git a/integrations/optimum/pyproject.toml b/integrations/optimum/pyproject.toml index 342878bb8..c248ab91c 100644 --- a/integrations/optimum/pyproject.toml +++ b/integrations/optimum/pyproject.toml @@ -89,7 +89,7 @@ all = ["style", "typing"] allow-direct-references = true [tool.ruff.lint.isort] -known-first-party = ["src"] +known-first-party = ["haystack_integrations"] [tool.black] target-version = ["py38"] diff --git a/integrations/pgvector/examples/embedding_retrieval.py b/integrations/pgvector/examples/embedding_retrieval.py index 37ea88929..b20a7a143 100644 --- a/integrations/pgvector/examples/embedding_retrieval.py +++ b/integrations/pgvector/examples/embedding_retrieval.py @@ -17,6 +17,7 @@ from haystack.components.embedders import SentenceTransformersDocumentEmbedder, SentenceTransformersTextEmbedder from haystack.components.preprocessors import DocumentSplitter from haystack.components.writers import DocumentWriter + from haystack_integrations.components.retrievers.pgvector import PgvectorEmbeddingRetriever from haystack_integrations.document_stores.pgvector import PgvectorDocumentStore diff --git a/integrations/pgvector/examples/hybrid_retrieval.py b/integrations/pgvector/examples/hybrid_retrieval.py index cee98fe08..7d110f60e 100644 --- a/integrations/pgvector/examples/hybrid_retrieval.py +++ b/integrations/pgvector/examples/hybrid_retrieval.py @@ -18,6 +18,7 @@ from haystack.components.joiners import DocumentJoiner from haystack.components.preprocessors import DocumentSplitter from haystack.components.writers import DocumentWriter + from haystack_integrations.components.retrievers.pgvector import PgvectorEmbeddingRetriever, PgvectorKeywordRetriever from haystack_integrations.document_stores.pgvector import PgvectorDocumentStore diff --git a/integrations/pgvector/pyproject.toml b/integrations/pgvector/pyproject.toml index cd1c69189..014d163bc 100644 --- a/integrations/pgvector/pyproject.toml +++ b/integrations/pgvector/pyproject.toml @@ -131,7 +131,7 @@ unfixable = [ ] [tool.ruff.lint.isort] -known-first-party = ["src"] +known-first-party = ["haystack_integrations"] [tool.ruff.lint.flake8-tidy-imports] ban-relative-imports = "parents" diff --git a/integrations/pgvector/src/haystack_integrations/components/retrievers/pgvector/embedding_retriever.py b/integrations/pgvector/src/haystack_integrations/components/retrievers/pgvector/embedding_retriever.py index 22aab1a73..3df5261c6 100644 --- a/integrations/pgvector/src/haystack_integrations/components/retrievers/pgvector/embedding_retriever.py +++ b/integrations/pgvector/src/haystack_integrations/components/retrievers/pgvector/embedding_retriever.py @@ -7,6 +7,7 @@ from haystack.dataclasses import Document from haystack.document_stores.types import FilterPolicy from haystack.document_stores.types.filter_policy import apply_filter_policy + from haystack_integrations.document_stores.pgvector import PgvectorDocumentStore from haystack_integrations.document_stores.pgvector.document_store import VALID_VECTOR_FUNCTIONS diff --git a/integrations/pgvector/src/haystack_integrations/components/retrievers/pgvector/keyword_retriever.py b/integrations/pgvector/src/haystack_integrations/components/retrievers/pgvector/keyword_retriever.py index 636471c31..32f95da64 100644 --- a/integrations/pgvector/src/haystack_integrations/components/retrievers/pgvector/keyword_retriever.py +++ b/integrations/pgvector/src/haystack_integrations/components/retrievers/pgvector/keyword_retriever.py @@ -7,6 +7,7 @@ from haystack.dataclasses import Document from haystack.document_stores.types import FilterPolicy from haystack.document_stores.types.filter_policy import apply_filter_policy + from haystack_integrations.document_stores.pgvector import PgvectorDocumentStore diff --git a/integrations/pgvector/tests/conftest.py b/integrations/pgvector/tests/conftest.py index b53589763..0c3d27088 100644 --- a/integrations/pgvector/tests/conftest.py +++ b/integrations/pgvector/tests/conftest.py @@ -2,6 +2,7 @@ from unittest.mock import patch import pytest + from haystack_integrations.document_stores.pgvector import PgvectorDocumentStore diff --git a/integrations/pgvector/tests/test_document_store.py b/integrations/pgvector/tests/test_document_store.py index eca8190ee..93514b71c 100644 --- a/integrations/pgvector/tests/test_document_store.py +++ b/integrations/pgvector/tests/test_document_store.py @@ -11,9 +11,10 @@ from haystack.document_stores.types import DuplicatePolicy from haystack.testing.document_store import CountDocumentsTest, DeleteDocumentsTest, WriteDocumentsTest from haystack.utils import Secret -from haystack_integrations.document_stores.pgvector import PgvectorDocumentStore from pandas import DataFrame +from haystack_integrations.document_stores.pgvector import PgvectorDocumentStore + @pytest.mark.integration class TestDocumentStore(CountDocumentsTest, WriteDocumentsTest, DeleteDocumentsTest): diff --git a/integrations/pgvector/tests/test_embedding_retrieval.py b/integrations/pgvector/tests/test_embedding_retrieval.py index 2c384f57c..46add79e1 100644 --- a/integrations/pgvector/tests/test_embedding_retrieval.py +++ b/integrations/pgvector/tests/test_embedding_retrieval.py @@ -6,9 +6,10 @@ import pytest from haystack.dataclasses.document import Document -from haystack_integrations.document_stores.pgvector import PgvectorDocumentStore from numpy.random import rand +from haystack_integrations.document_stores.pgvector import PgvectorDocumentStore + @pytest.mark.integration class TestEmbeddingRetrieval: diff --git a/integrations/pgvector/tests/test_filters.py b/integrations/pgvector/tests/test_filters.py index bda10e3c0..08e693471 100644 --- a/integrations/pgvector/tests/test_filters.py +++ b/integrations/pgvector/tests/test_filters.py @@ -3,6 +3,10 @@ import pytest from haystack.dataclasses.document import Document from haystack.testing.document_store import FilterDocumentsTest +from pandas import DataFrame +from psycopg.sql import SQL +from psycopg.types.json import Jsonb + from haystack_integrations.document_stores.pgvector.filters import ( FilterError, _convert_filters_to_where_clause_and_params, @@ -10,9 +14,6 @@ _parse_logical_condition, _treat_meta_field, ) -from pandas import DataFrame -from psycopg.sql import SQL -from psycopg.types.json import Jsonb @pytest.mark.integration diff --git a/integrations/pgvector/tests/test_keyword_retrieval.py b/integrations/pgvector/tests/test_keyword_retrieval.py index 4a5614165..859a61a5f 100644 --- a/integrations/pgvector/tests/test_keyword_retrieval.py +++ b/integrations/pgvector/tests/test_keyword_retrieval.py @@ -1,5 +1,6 @@ import pytest from haystack.dataclasses.document import Document + from haystack_integrations.document_stores.pgvector import PgvectorDocumentStore diff --git a/integrations/pgvector/tests/test_retrievers.py b/integrations/pgvector/tests/test_retrievers.py index 058c435ca..290891307 100644 --- a/integrations/pgvector/tests/test_retrievers.py +++ b/integrations/pgvector/tests/test_retrievers.py @@ -7,6 +7,7 @@ from haystack.dataclasses import Document from haystack.document_stores.types import FilterPolicy from haystack.utils.auth import EnvVarSecret + from haystack_integrations.components.retrievers.pgvector import PgvectorEmbeddingRetriever, PgvectorKeywordRetriever from haystack_integrations.document_stores.pgvector import PgvectorDocumentStore diff --git a/integrations/ragas/pyproject.toml b/integrations/ragas/pyproject.toml index cc129931a..ad3a83c7d 100644 --- a/integrations/ragas/pyproject.toml +++ b/integrations/ragas/pyproject.toml @@ -133,7 +133,7 @@ unfixable = [ ] [tool.ruff.lint.isort] -known-first-party = ["src"] +known-first-party = ["haystack_integrations"] [tool.ruff.lint.flake8-tidy-imports] ban-relative-imports = "all" diff --git a/integrations/snowflake/pyproject.toml b/integrations/snowflake/pyproject.toml index fe7a18ec6..355e9d090 100644 --- a/integrations/snowflake/pyproject.toml +++ b/integrations/snowflake/pyproject.toml @@ -126,7 +126,7 @@ unfixable = [ ] [tool.ruff.lint.isort] -known-first-party = ["snowflake_haystack"] +known-first-party = ["haystack_integrations"] [tool.ruff.lint.flake8-tidy-imports] ban-relative-imports = "parents" diff --git a/integrations/unstructured/pyproject.toml b/integrations/unstructured/pyproject.toml index 218a51711..88bd463b2 100644 --- a/integrations/unstructured/pyproject.toml +++ b/integrations/unstructured/pyproject.toml @@ -133,7 +133,7 @@ unfixable = [ ] [tool.ruff.lint.isort] -known-first-party = ["src"] +known-first-party = ["haystack_integrations"] [tool.ruff.lint.flake8-tidy-imports] ban-relative-imports = "parents" diff --git a/integrations/unstructured/tests/test_converter.py b/integrations/unstructured/tests/test_converter.py index 5d1a6c091..063289b07 100644 --- a/integrations/unstructured/tests/test_converter.py +++ b/integrations/unstructured/tests/test_converter.py @@ -2,6 +2,7 @@ # # SPDX-License-Identifier: Apache-2.0 import pytest + from haystack_integrations.components.converters.unstructured import UnstructuredFileConverter diff --git a/integrations/weaviate/pyproject.toml b/integrations/weaviate/pyproject.toml index 075422ba0..22d3a160d 100644 --- a/integrations/weaviate/pyproject.toml +++ b/integrations/weaviate/pyproject.toml @@ -128,7 +128,7 @@ unfixable = [ ] [tool.ruff.lint.isort] -known-first-party = ["src"] +known-first-party = ["haystack_integrations"] [tool.ruff.lint.flake8-tidy-imports] ban-relative-imports = "parents" From 5d9abf859081e59db30397c535c7c92e67b94e94 Mon Sep 17 00:00:00 2001 From: anakin87 Date: Wed, 25 Sep 2024 19:27:49 +0200 Subject: [PATCH 5/8] more changes --- .../instructor_embedders/tests/test_instructor_backend.py | 1 + .../tests/test_instructor_document_embedder.py | 1 + .../tests/test_instructor_text_embedder.py | 1 + integrations/qdrant/examples/embedding_retrieval.py | 1 + .../components/retrievers/qdrant/retriever.py | 3 ++- .../document_stores/qdrant/migrate_to_sparse.py | 3 ++- integrations/qdrant/tests/test_converters.py | 3 ++- integrations/qdrant/tests/test_dict_converters.py | 1 + integrations/qdrant/tests/test_document_store.py | 3 ++- integrations/qdrant/tests/test_filters.py | 3 ++- integrations/qdrant/tests/test_retriever.py | 1 + 11 files changed, 16 insertions(+), 5 deletions(-) diff --git a/integrations/instructor_embedders/tests/test_instructor_backend.py b/integrations/instructor_embedders/tests/test_instructor_backend.py index 85c1f012a..fdf6e44be 100644 --- a/integrations/instructor_embedders/tests/test_instructor_backend.py +++ b/integrations/instructor_embedders/tests/test_instructor_backend.py @@ -1,6 +1,7 @@ from unittest.mock import patch from haystack.utils.auth import Secret + from haystack_integrations.components.embedders.instructor_embedders.embedding_backend.instructor_backend import ( _InstructorEmbeddingBackendFactory, ) diff --git a/integrations/instructor_embedders/tests/test_instructor_document_embedder.py b/integrations/instructor_embedders/tests/test_instructor_document_embedder.py index 44f740679..f1676b411 100644 --- a/integrations/instructor_embedders/tests/test_instructor_document_embedder.py +++ b/integrations/instructor_embedders/tests/test_instructor_document_embedder.py @@ -4,6 +4,7 @@ import pytest from haystack import Document from haystack.utils import ComponentDevice, Secret + from haystack_integrations.components.embedders.instructor_embedders import InstructorDocumentEmbedder diff --git a/integrations/instructor_embedders/tests/test_instructor_text_embedder.py b/integrations/instructor_embedders/tests/test_instructor_text_embedder.py index 55022f1ec..68e3e5d62 100644 --- a/integrations/instructor_embedders/tests/test_instructor_text_embedder.py +++ b/integrations/instructor_embedders/tests/test_instructor_text_embedder.py @@ -3,6 +3,7 @@ import numpy as np import pytest from haystack.utils import ComponentDevice, Secret + from haystack_integrations.components.embedders.instructor_embedders import InstructorTextEmbedder diff --git a/integrations/qdrant/examples/embedding_retrieval.py b/integrations/qdrant/examples/embedding_retrieval.py index f009191e7..84f12f4fe 100644 --- a/integrations/qdrant/examples/embedding_retrieval.py +++ b/integrations/qdrant/examples/embedding_retrieval.py @@ -12,6 +12,7 @@ from haystack.components.embedders import SentenceTransformersDocumentEmbedder, SentenceTransformersTextEmbedder from haystack.components.preprocessors import DocumentSplitter from haystack.components.writers import DocumentWriter + from haystack_integrations.components.retrievers.qdrant import QdrantEmbeddingRetriever from haystack_integrations.document_stores.qdrant import QdrantDocumentStore diff --git a/integrations/qdrant/src/haystack_integrations/components/retrievers/qdrant/retriever.py b/integrations/qdrant/src/haystack_integrations/components/retrievers/qdrant/retriever.py index 334df9bb8..fee9a6182 100644 --- a/integrations/qdrant/src/haystack_integrations/components/retrievers/qdrant/retriever.py +++ b/integrations/qdrant/src/haystack_integrations/components/retrievers/qdrant/retriever.py @@ -4,9 +4,10 @@ from haystack.dataclasses.sparse_embedding import SparseEmbedding from haystack.document_stores.types import FilterPolicy from haystack.document_stores.types.filter_policy import apply_filter_policy -from haystack_integrations.document_stores.qdrant import QdrantDocumentStore from qdrant_client.http import models +from haystack_integrations.document_stores.qdrant import QdrantDocumentStore + @component class QdrantEmbeddingRetriever: diff --git a/integrations/qdrant/src/haystack_integrations/document_stores/qdrant/migrate_to_sparse.py b/integrations/qdrant/src/haystack_integrations/document_stores/qdrant/migrate_to_sparse.py index 1fabbfd9c..9eb4ca088 100644 --- a/integrations/qdrant/src/haystack_integrations/document_stores/qdrant/migrate_to_sparse.py +++ b/integrations/qdrant/src/haystack_integrations/document_stores/qdrant/migrate_to_sparse.py @@ -1,9 +1,10 @@ import logging import time -from haystack_integrations.document_stores.qdrant import QdrantDocumentStore from qdrant_client.http import models +from haystack_integrations.document_stores.qdrant import QdrantDocumentStore + logger = logging.getLogger(__name__) logger.addHandler(logging.StreamHandler()) logger.setLevel(logging.INFO) diff --git a/integrations/qdrant/tests/test_converters.py b/integrations/qdrant/tests/test_converters.py index 242c4cafe..566da49ab 100644 --- a/integrations/qdrant/tests/test_converters.py +++ b/integrations/qdrant/tests/test_converters.py @@ -1,9 +1,10 @@ import numpy as np +from qdrant_client.http import models as rest + from haystack_integrations.document_stores.qdrant.converters import ( convert_id, convert_qdrant_point_to_haystack_document, ) -from qdrant_client.http import models as rest def test_convert_id_is_deterministic(): diff --git a/integrations/qdrant/tests/test_dict_converters.py b/integrations/qdrant/tests/test_dict_converters.py index 3871dbff0..8ea5b5595 100644 --- a/integrations/qdrant/tests/test_dict_converters.py +++ b/integrations/qdrant/tests/test_dict_converters.py @@ -1,4 +1,5 @@ from haystack.utils import Secret + from haystack_integrations.document_stores.qdrant import QdrantDocumentStore diff --git a/integrations/qdrant/tests/test_document_store.py b/integrations/qdrant/tests/test_document_store.py index fc777e4c7..79523531b 100644 --- a/integrations/qdrant/tests/test_document_store.py +++ b/integrations/qdrant/tests/test_document_store.py @@ -12,12 +12,13 @@ WriteDocumentsTest, _random_embeddings, ) +from qdrant_client.http import models as rest + from haystack_integrations.document_stores.qdrant.document_store import ( SPARSE_VECTORS_NAME, QdrantDocumentStore, QdrantStoreError, ) -from qdrant_client.http import models as rest class TestQdrantDocumentStore(CountDocumentsTest, WriteDocumentsTest, DeleteDocumentsTest): diff --git a/integrations/qdrant/tests/test_filters.py b/integrations/qdrant/tests/test_filters.py index fd070bda9..1afd2b7f3 100644 --- a/integrations/qdrant/tests/test_filters.py +++ b/integrations/qdrant/tests/test_filters.py @@ -4,9 +4,10 @@ from haystack import Document from haystack.testing.document_store import FilterDocumentsTest from haystack.utils.filters import FilterError -from haystack_integrations.document_stores.qdrant import QdrantDocumentStore from qdrant_client.http import models +from haystack_integrations.document_stores.qdrant import QdrantDocumentStore + class TestQdrantStoreBaseTests(FilterDocumentsTest): @pytest.fixture diff --git a/integrations/qdrant/tests/test_retriever.py b/integrations/qdrant/tests/test_retriever.py index 426423d5d..bd6b92842 100644 --- a/integrations/qdrant/tests/test_retriever.py +++ b/integrations/qdrant/tests/test_retriever.py @@ -8,6 +8,7 @@ FilterableDocsFixtureMixin, _random_embeddings, ) + from haystack_integrations.components.retrievers.qdrant import ( QdrantEmbeddingRetriever, QdrantHybridRetriever, From 20fe0c8c0d97687f35bcf9bdbec481d43121f41e Mon Sep 17 00:00:00 2001 From: anakin87 Date: Wed, 25 Sep 2024 19:58:46 +0200 Subject: [PATCH 6/8] mmore and more changes --- integrations/astra/pyproject.toml | 1 - integrations/deepeval/example/example.py | 1 + integrations/deepeval/pyproject.toml | 2 +- integrations/deepeval/tests/test_evaluator.py | 2 +- integrations/langfuse/example/basic_rag.py | 1 + integrations/langfuse/pyproject.toml | 2 +- integrations/langfuse/tests/test_langfuse_span.py | 2 ++ integrations/langfuse/tests/test_tracer.py | 2 +- integrations/langfuse/tests/test_tracing.py | 9 +++++---- integrations/ollama/pyproject.toml | 4 ++-- integrations/optimum/example/example.py | 4 ++-- integrations/optimum/pyproject.toml | 2 +- .../optimum/tests/test_optimum_document_embedder.py | 13 ++++++------- .../optimum/tests/test_optimum_text_embedder.py | 5 +++-- integrations/ragas/pyproject.toml | 2 +- integrations/ragas/tests/test_evaluator.py | 3 ++- 16 files changed, 30 insertions(+), 25 deletions(-) diff --git a/integrations/astra/pyproject.toml b/integrations/astra/pyproject.toml index 9ecbd43df..25bcf20b8 100644 --- a/integrations/astra/pyproject.toml +++ b/integrations/astra/pyproject.toml @@ -127,7 +127,6 @@ unfixable = [ # Don't touch unused imports "F401", ] -exclude = ["example"] [tool.ruff.lint.isort] known-first-party = ["haystack_integrations"] diff --git a/integrations/deepeval/example/example.py b/integrations/deepeval/example/example.py index e1265a739..97a26ef34 100644 --- a/integrations/deepeval/example/example.py +++ b/integrations/deepeval/example/example.py @@ -1,6 +1,7 @@ # A valid OpenAI API key is required to run this example. from haystack import Pipeline + from haystack_integrations.components.evaluators.deepeval import DeepEvalEvaluator, DeepEvalMetric QUESTIONS = [ diff --git a/integrations/deepeval/pyproject.toml b/integrations/deepeval/pyproject.toml index 3e22053c6..5d81fa0a5 100644 --- a/integrations/deepeval/pyproject.toml +++ b/integrations/deepeval/pyproject.toml @@ -71,7 +71,7 @@ skip-string-normalization = true [tool.ruff] target-version = "py38" line-length = 120 -extend-exclude = ["tests", "example"] +exclude = ["example", "tests"] [tool.ruff.lint] select = [ diff --git a/integrations/deepeval/tests/test_evaluator.py b/integrations/deepeval/tests/test_evaluator.py index 7d1946185..24b9ba7ea 100644 --- a/integrations/deepeval/tests/test_evaluator.py +++ b/integrations/deepeval/tests/test_evaluator.py @@ -5,10 +5,10 @@ from unittest.mock import patch import pytest +from deepeval.evaluate import BaseMetric, TestResult from haystack import DeserializationError from haystack_integrations.components.evaluators.deepeval import DeepEvalEvaluator, DeepEvalMetric -from deepeval.evaluate import TestResult, BaseMetric DEFAULT_QUESTIONS = [ "Which is the most popular global sport?", diff --git a/integrations/langfuse/example/basic_rag.py b/integrations/langfuse/example/basic_rag.py index 492a14d49..b1d5e620f 100644 --- a/integrations/langfuse/example/basic_rag.py +++ b/integrations/langfuse/example/basic_rag.py @@ -10,6 +10,7 @@ from haystack.components.generators import OpenAIGenerator from haystack.components.retrievers import InMemoryEmbeddingRetriever from haystack.document_stores.in_memory import InMemoryDocumentStore + from haystack_integrations.components.connectors.langfuse import LangfuseConnector diff --git a/integrations/langfuse/pyproject.toml b/integrations/langfuse/pyproject.toml index da02b1346..61de4596c 100644 --- a/integrations/langfuse/pyproject.toml +++ b/integrations/langfuse/pyproject.toml @@ -84,7 +84,7 @@ skip-string-normalization = true [tool.ruff] target-version = "py38" line-length = 120 -extend-exclude = ["tests", "example"] +exclude = ["example", "tests"] [tool.ruff.lint] select = [ diff --git a/integrations/langfuse/tests/test_langfuse_span.py b/integrations/langfuse/tests/test_langfuse_span.py index a5a5f2c13..7ea82ba97 100644 --- a/integrations/langfuse/tests/test_langfuse_span.py +++ b/integrations/langfuse/tests/test_langfuse_span.py @@ -3,7 +3,9 @@ os.environ["HAYSTACK_CONTENT_TRACING_ENABLED"] = "true" from unittest.mock import Mock + from haystack.dataclasses import ChatMessage + from haystack_integrations.tracing.langfuse.tracer import LangfuseSpan diff --git a/integrations/langfuse/tests/test_tracer.py b/integrations/langfuse/tests/test_tracer.py index 241581a72..c6bf4acdf 100644 --- a/integrations/langfuse/tests/test_tracer.py +++ b/integrations/langfuse/tests/test_tracer.py @@ -1,5 +1,5 @@ import os -from unittest.mock import Mock, MagicMock, patch +from unittest.mock import MagicMock, Mock, patch from haystack_integrations.tracing.langfuse.tracer import LangfuseTracer diff --git a/integrations/langfuse/tests/test_tracing.py b/integrations/langfuse/tests/test_tracing.py index 05acf750e..936064e0a 100644 --- a/integrations/langfuse/tests/test_tracing.py +++ b/integrations/langfuse/tests/test_tracing.py @@ -1,16 +1,17 @@ import os import random import time -import pytest from urllib.parse import urlparse + +import pytest import requests -from requests.auth import HTTPBasicAuth from haystack import Pipeline from haystack.components.builders import ChatPromptBuilder -from haystack.dataclasses import ChatMessage -from haystack_integrations.components.connectors.langfuse import LangfuseConnector from haystack.components.generators.chat import OpenAIChatGenerator +from haystack.dataclasses import ChatMessage +from requests.auth import HTTPBasicAuth +from haystack_integrations.components.connectors.langfuse import LangfuseConnector from haystack_integrations.components.generators.anthropic import AnthropicChatGenerator from haystack_integrations.components.generators.cohere import CohereChatGenerator diff --git a/integrations/ollama/pyproject.toml b/integrations/ollama/pyproject.toml index bd01bc149..bc8555140 100644 --- a/integrations/ollama/pyproject.toml +++ b/integrations/ollama/pyproject.toml @@ -71,8 +71,8 @@ dependencies = ["black>=23.1.0", "mypy>=1.0.0", "ruff>=0.0.243"] [tool.hatch.envs.lint.scripts] typing = "mypy --install-types --non-interactive --explicit-package-bases {args:src/ tests}" -style = ["ruff check {args:. --exclude tests/, examples/ }", "black --check --diff {args:.}"] -fmt = ["black {args:.}", "ruff check --fix {args:. --exclude tests/, examples/ }", "style"] +style = ["ruff check {args:.}", "black --check --diff {args:.}"] +fmt = ["black {args:.}", "ruff check --fix {args:.}", "style"] all = ["style", "typing"] [tool.hatch.metadata] diff --git a/integrations/optimum/example/example.py b/integrations/optimum/example/example.py index 0d86ce99b..a1e22f575 100644 --- a/integrations/optimum/example/example.py +++ b/integrations/optimum/example/example.py @@ -3,10 +3,10 @@ from haystack import Pipeline from haystack_integrations.components.embedders.optimum import ( - OptimumTextEmbedder, - OptimumEmbedderPooling, OptimumEmbedderOptimizationConfig, OptimumEmbedderOptimizationMode, + OptimumEmbedderPooling, + OptimumTextEmbedder, ) pipeline = Pipeline() diff --git a/integrations/optimum/pyproject.toml b/integrations/optimum/pyproject.toml index c248ab91c..305af6042 100644 --- a/integrations/optimum/pyproject.toml +++ b/integrations/optimum/pyproject.toml @@ -99,7 +99,7 @@ skip-string-normalization = true [tool.ruff] target-version = "py38" line-length = 120 -extend-exclude = ["tests", "example"] +exclude = ["example", "tests"] [tool.ruff.lint] select = [ diff --git a/integrations/optimum/tests/test_optimum_document_embedder.py b/integrations/optimum/tests/test_optimum_document_embedder.py index 9288bb688..7c8ca02e0 100644 --- a/integrations/optimum/tests/test_optimum_document_embedder.py +++ b/integrations/optimum/tests/test_optimum_document_embedder.py @@ -1,21 +1,22 @@ -from unittest.mock import MagicMock, patch -import tempfile import copy +import tempfile +from unittest.mock import MagicMock, patch import pytest from haystack.dataclasses import Document from haystack.utils.auth import Secret +from huggingface_hub.utils import RepositoryNotFoundError + from haystack_integrations.components.embedders.optimum import OptimumDocumentEmbedder -from haystack_integrations.components.embedders.optimum.pooling import OptimumEmbedderPooling from haystack_integrations.components.embedders.optimum.optimization import ( OptimumEmbedderOptimizationConfig, OptimumEmbedderOptimizationMode, ) +from haystack_integrations.components.embedders.optimum.pooling import OptimumEmbedderPooling from haystack_integrations.components.embedders.optimum.quantization import ( OptimumEmbedderQuantizationConfig, OptimumEmbedderQuantizationMode, ) -from huggingface_hub.utils import RepositoryNotFoundError @pytest.fixture @@ -147,9 +148,7 @@ def test_to_and_from_dict(self, mock_check_valid_model, mock_get_pooling_mode): assert embedder._backend.parameters.optimizer_settings is None assert embedder._backend.parameters.quantizer_settings is None - def test_to_and_from_dict_with_custom_init_parameters( - self, mock_check_valid_model, mock_get_pooling_mode - ): # noqa: ARG002 + def test_to_and_from_dict_with_custom_init_parameters(self, mock_check_valid_model, mock_get_pooling_mode): component = OptimumDocumentEmbedder( model="sentence-transformers/all-minilm-l6-v2", token=Secret.from_env_var("ENV_VAR", strict=False), diff --git a/integrations/optimum/tests/test_optimum_text_embedder.py b/integrations/optimum/tests/test_optimum_text_embedder.py index ad0e7d800..db42ec26d 100644 --- a/integrations/optimum/tests/test_optimum_text_embedder.py +++ b/integrations/optimum/tests/test_optimum_text_embedder.py @@ -2,17 +2,18 @@ import pytest from haystack.utils.auth import Secret +from huggingface_hub.utils import RepositoryNotFoundError + from haystack_integrations.components.embedders.optimum import OptimumTextEmbedder -from haystack_integrations.components.embedders.optimum.pooling import OptimumEmbedderPooling from haystack_integrations.components.embedders.optimum.optimization import ( OptimumEmbedderOptimizationConfig, OptimumEmbedderOptimizationMode, ) +from haystack_integrations.components.embedders.optimum.pooling import OptimumEmbedderPooling from haystack_integrations.components.embedders.optimum.quantization import ( OptimumEmbedderQuantizationConfig, OptimumEmbedderQuantizationMode, ) -from huggingface_hub.utils import RepositoryNotFoundError @pytest.fixture diff --git a/integrations/ragas/pyproject.toml b/integrations/ragas/pyproject.toml index ad3a83c7d..dd56e35f6 100644 --- a/integrations/ragas/pyproject.toml +++ b/integrations/ragas/pyproject.toml @@ -77,7 +77,7 @@ skip-string-normalization = true [tool.ruff] target-version = "py38" line-length = 120 -extend-exclude = ["tests", "example"] +exclude = ["example", "tests"] [tool.ruff.lint] select = [ diff --git a/integrations/ragas/tests/test_evaluator.py b/integrations/ragas/tests/test_evaluator.py index fc8901c32..0f847ed0b 100644 --- a/integrations/ragas/tests/test_evaluator.py +++ b/integrations/ragas/tests/test_evaluator.py @@ -5,10 +5,11 @@ import pytest from datasets import Dataset from haystack import DeserializationError -from haystack_integrations.components.evaluators.ragas import RagasEvaluator, RagasMetric from ragas.evaluation import Result from ragas.metrics.base import Metric +from haystack_integrations.components.evaluators.ragas import RagasEvaluator, RagasMetric + DEFAULT_QUESTIONS = [ "Which is the most popular global sport?", "Who created the Python language?", From 5055ea4e3af3e3252321b8ee3700d8d32eea88e1 Mon Sep 17 00:00:00 2001 From: anakin87 Date: Wed, 25 Sep 2024 20:22:33 +0200 Subject: [PATCH 7/8] right concurrency group for anthropic --- .github/workflows/anthropic.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/anthropic.yml b/.github/workflows/anthropic.yml index c4cdeb2d1..52ba5c9d4 100644 --- a/.github/workflows/anthropic.yml +++ b/.github/workflows/anthropic.yml @@ -15,7 +15,7 @@ defaults: working-directory: integrations/anthropic concurrency: - group: cohere-${{ github.head_ref }} + group: anthropic-${{ github.head_ref }} cancel-in-progress: true env: From 95f387ac49e545b03d4a3585826de58f98d390fd Mon Sep 17 00:00:00 2001 From: anakin87 Date: Thu, 26 Sep 2024 16:28:37 +0200 Subject: [PATCH 8/8] apply suggestions --- integrations/instructor_embedders/pyproject.toml | 2 +- .../tests/test_snowflake_table_retriever.py | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/integrations/instructor_embedders/pyproject.toml b/integrations/instructor_embedders/pyproject.toml index 42e71af5d..458c0ae0c 100644 --- a/integrations/instructor_embedders/pyproject.toml +++ b/integrations/instructor_embedders/pyproject.toml @@ -155,7 +155,7 @@ unfixable = [ ] [tool.ruff.lint.isort] -known-first-party = ["instructor_embedders"] +known-first-party = ["haystack_integrations"] [tool.ruff.lint.flake8-tidy-imports] ban-relative-imports = "parents" diff --git a/integrations/snowflake/tests/test_snowflake_table_retriever.py b/integrations/snowflake/tests/test_snowflake_table_retriever.py index f0fc3b99f..f5b8fee37 100644 --- a/integrations/snowflake/tests/test_snowflake_table_retriever.py +++ b/integrations/snowflake/tests/test_snowflake_table_retriever.py @@ -477,10 +477,11 @@ def test_to_dict_default(self, monkeypatch: MagicMock) -> None: data = component.to_dict() - t = "haystack_integrations.components.retrievers.snowflake.snowflake_table_retriever.SnowflakeTableRetriever" - assert data == { - "type": t, + "type": ( + "haystack_integrations.components.retrievers.snowflake." + "snowflake_table_retriever.SnowflakeTableRetriever" + ), "init_parameters": { "api_key": { "env_vars": ["SNOWFLAKE_API_KEY"], @@ -511,10 +512,11 @@ def test_to_dict_with_parameters(self, monkeypatch: MagicMock) -> None: data = component.to_dict() - t = "haystack_integrations.components.retrievers.snowflake.snowflake_table_retriever.SnowflakeTableRetriever" - assert data == { - "type": t, + "type": ( + "haystack_integrations.components.retrievers.snowflake." + "snowflake_table_retriever.SnowflakeTableRetriever" + ), "init_parameters": { "api_key": { "env_vars": ["SNOWFLAKE_API_KEY"],