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", ]