Skip to content

Commit

Permalink
more changes
Browse files Browse the repository at this point in the history
  • Loading branch information
anakin87 committed Sep 25, 2024
1 parent dfc2125 commit 1f8fb44
Show file tree
Hide file tree
Showing 58 changed files with 90 additions and 44 deletions.
2 changes: 2 additions & 0 deletions integrations/amazon_bedrock/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ skip-string-normalization = true
[tool.ruff]
target-version = "py38"
line-length = 120

[tool.ruff.lint]
select = [
"A",
"ARG",
Expand Down
2 changes: 2 additions & 0 deletions integrations/amazon_sagemaker/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ skip-string-normalization = true
[tool.ruff]
target-version = "py38"
line-length = 120

[tool.ruff.lint]
select = [
"A",
"ARG",
Expand Down
2 changes: 2 additions & 0 deletions integrations/anthropic/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ skip-string-normalization = true
[tool.ruff]
target-version = "py38"
line-length = 120

[tool.ruff.lint]
select = [
"A",
"ARG",
Expand Down
10 changes: 6 additions & 4 deletions integrations/astra/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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)`
Expand All @@ -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"]
Expand Down
8 changes: 5 additions & 3 deletions integrations/chroma/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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)`
Expand All @@ -130,7 +132,7 @@ lint.ignore = [
# Ignore unused params
"ARG002",
]
lint.unfixable = [
unfixable = [
# Don't touch unused imports
"F401",
]
Expand Down
1 change: 0 additions & 1 deletion integrations/cohere/examples/cohere_embedding.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
1 change: 0 additions & 1 deletion integrations/cohere/examples/cohere_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion integrations/cohere/examples/cohere_ranker.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 2 additions & 0 deletions integrations/cohere/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ skip-string-normalization = true
[tool.ruff]
target-version = "py38"
line-length = 120

[tool.ruff.lint]
select = [
"A",
"ARG",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions integrations/cohere/tests/test_cohere_chat_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions integrations/cohere/tests/test_cohere_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions integrations/cohere/tests/test_cohere_ranker.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions integrations/cohere/tests/test_document_embedder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions integrations/cohere/tests/test_text_embedder.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import pytest
from haystack.utils import Secret

from haystack_integrations.components.embedders.cohere import CohereTextEmbedder

pytestmark = pytest.mark.embedders
Expand Down
4 changes: 3 additions & 1 deletion integrations/deepeval/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -121,7 +124,6 @@ unfixable = [
# Don't touch unused imports
"F401",
]
extend-exclude = ["tests", "example"]

[tool.ruff.lint.isort]
known-first-party = ["src"]
Expand Down
2 changes: 2 additions & 0 deletions integrations/elasticsearch/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ skip-string-normalization = true
[tool.ruff]
target-version = "py38"
line-length = 120

[tool.ruff.lint]
select = [
"A",
"ARG",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
1 change: 0 additions & 1 deletion integrations/fastembed/examples/example.py
Original file line number Diff line number Diff line change
@@ -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")
Expand Down
1 change: 0 additions & 1 deletion integrations/fastembed/examples/sparse_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
# involving indexing and retrieval of documents.

from haystack import Document

from haystack_integrations.components.embedders.fastembed import FastembedSparseDocumentEmbedder

document_list = [
Expand Down
2 changes: 2 additions & 0 deletions integrations/fastembed/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ skip-string-normalization = true
[tool.ruff]
target-version = "py38"
line-length = 120

[tool.ruff.lint]
select = [
"A",
"ARG",
Expand Down
2 changes: 2 additions & 0 deletions integrations/google_ai/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ skip-string-normalization = true
[tool.ruff]
target-version = "py38"
line-length = 120

[tool.ruff.lint]
select = [
"A",
"ARG",
Expand Down
2 changes: 2 additions & 0 deletions integrations/google_vertex/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ skip-string-normalization = true
[tool.ruff]
target-version = "py38"
line-length = 120

[tool.ruff.lint]
select = [
"A",
"ARG",
Expand Down
2 changes: 2 additions & 0 deletions integrations/instructor_embedders/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 2 additions & 0 deletions integrations/jina/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ skip-string-normalization = true
[tool.ruff]
target-version = "py38"
line-length = 120

[tool.ruff.lint]
select = [
"A",
"ARG",
Expand Down
11 changes: 6 additions & 5 deletions integrations/langfuse/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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
Expand All @@ -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"]
Expand Down
1 change: 0 additions & 1 deletion integrations/llama_cpp/examples/rag_pipeline_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions integrations/llama_cpp/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ skip-string-normalization = true
[tool.ruff]
target-version = "py38"
line-length = 120

[tool.ruff.lint]
select = [
"A",
"ARG",
Expand Down
2 changes: 2 additions & 0 deletions integrations/mistral/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ skip-string-normalization = true
[tool.ruff]
target-version = "py38"
line-length = 120

[tool.ruff.lint]
select = [
"A",
"ARG",
Expand Down
3 changes: 2 additions & 1 deletion integrations/mistral/tests/test_mistral_chat_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions integrations/mistral/tests/test_mistral_text_embedder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions integrations/mongodb_atlas/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ skip-string-normalization = true
[tool.ruff]
target-version = "py38"
line-length = 120

[tool.ruff.lint]
select = [
"A",
"ARG",
Expand Down
2 changes: 2 additions & 0 deletions integrations/nvidia/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ skip-string-normalization = true
[tool.ruff]
target-version = "py38"
line-length = 120

[tool.ruff.lint]
select = [
"A",
"ARG",
Expand Down
Loading

0 comments on commit 1f8fb44

Please sign in to comment.