Skip to content

Commit

Permalink
fix: Lints in cohere-haystack (#995)
Browse files Browse the repository at this point in the history
  • Loading branch information
shadeMe authored Aug 16, 2024
1 parent 91d2acf commit 7885aa1
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 5 deletions.
1 change: 1 addition & 0 deletions integrations/cohere/examples/cohere_embedding.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
1 change: 1 addition & 0 deletions integrations/cohere/examples/cohere_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions integrations/cohere/examples/cohere_ranker.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
14 changes: 11 additions & 3 deletions integrations/cohere/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,12 @@ root = "../.."
git_describe_command = 'git describe --tags --match="integrations/cohere-v[0-9]*"'

[tool.hatch.envs.default]
dependencies = ["coverage[toml]>=6.5", "pytest", "pytest-rerunfailures", "haystack-pydoc-tools"]
dependencies = [
"coverage[toml]>=6.5",
"pytest",
"pytest-rerunfailures",
"haystack-pydoc-tools",
]
[tool.hatch.envs.default.scripts]
test = "pytest {args:tests}"
test-cov = "coverage run -m pytest {args:tests}"
Expand All @@ -59,8 +64,11 @@ 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:.}", "black --check --diff {args:.}"]
fmt = ["black {args:.}", "ruff --fix {args:.}", "style"]
style = [
"ruff check {args:. --exclude tests/}",
"black --check --diff {args:.}",
]
fmt = ["black {args:.}", "ruff --fix {args:. --exclude tests/}", "style"]
all = ["style", "typing"]

[tool.black]
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

0 comments on commit 7885aa1

Please sign in to comment.