-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor!: Use
Secret
for API keys in Cohere components (#386)
- Loading branch information
Showing
9 changed files
with
191 additions
and
180 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,9 +10,7 @@ readme = "README.md" | |
requires-python = ">=3.7" | ||
license = "Apache-2.0" | ||
keywords = [] | ||
authors = [ | ||
{ name = "deepset GmbH", email = "[email protected]" }, | ||
] | ||
authors = [{ name = "deepset GmbH", email = "[email protected]" }] | ||
classifiers = [ | ||
"Development Status :: 4 - Beta", | ||
"Programming Language :: Python", | ||
|
@@ -24,10 +22,7 @@ classifiers = [ | |
"Programming Language :: Python :: Implementation :: CPython", | ||
"Programming Language :: Python :: Implementation :: PyPy", | ||
] | ||
dependencies = [ | ||
"haystack-ai", | ||
"cohere", | ||
] | ||
dependencies = ["haystack-ai>=2.0.0b6", "cohere"] | ||
|
||
[project.urls] | ||
Documentation = "https://github.com/deepset-ai/haystack-core-integrations/tree/main/integrations/cohere#readme" | ||
|
@@ -46,51 +41,25 @@ root = "../.." | |
git_describe_command = 'git describe --tags --match="integrations/cohere-v[0-9]*"' | ||
|
||
[tool.hatch.envs.default] | ||
dependencies = [ | ||
"coverage[toml]>=6.5", | ||
"pytest", | ||
"haystack-pydoc-tools", | ||
] | ||
dependencies = ["coverage[toml]>=6.5", "pytest", "haystack-pydoc-tools"] | ||
[tool.hatch.envs.default.scripts] | ||
test = "pytest {args:tests}" | ||
test-cov = "coverage run -m pytest {args:tests}" | ||
cov-report = [ | ||
"- coverage combine", | ||
"coverage report", | ||
] | ||
cov = [ | ||
"test-cov", | ||
"cov-report", | ||
] | ||
docs = [ | ||
"pydoc-markdown pydoc/config.yml" | ||
] | ||
cov-report = ["- coverage combine", "coverage report"] | ||
cov = ["test-cov", "cov-report"] | ||
docs = ["pydoc-markdown pydoc/config.yml"] | ||
|
||
[[tool.hatch.envs.all.matrix]] | ||
python = ["3.7", "3.8", "3.9", "3.10", "3.11"] | ||
|
||
[tool.hatch.envs.lint] | ||
detached = true | ||
dependencies = [ | ||
"black>=23.1.0", | ||
"mypy>=1.0.0", | ||
"ruff>=0.0.243", | ||
] | ||
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 {args:.}", | ||
"black --check --diff {args:.}", | ||
] | ||
fmt = [ | ||
"black {args:.}", | ||
"ruff --fix {args:.}", | ||
"style", | ||
] | ||
all = [ | ||
"style", | ||
"typing", | ||
] | ||
style = ["ruff {args:.}", "black --check --diff {args:.}"] | ||
fmt = ["black {args:.}", "ruff --fix {args:.}", "style"] | ||
all = ["style", "typing"] | ||
|
||
[tool.black] | ||
target-version = ["py37"] | ||
|
@@ -130,9 +99,18 @@ ignore = [ | |
# Allow non-abstract empty methods in abstract base classes | ||
"B027", | ||
# Ignore checks for possible passwords | ||
"S105", "S106", "S107", | ||
"S105", | ||
"S106", | ||
"S107", | ||
# Ignore complexity | ||
"C901", "PLR0911", "PLR0912", "PLR0913", "PLR0915", | ||
"C901", | ||
"PLR0911", | ||
"PLR0912", | ||
"PLR0913", | ||
"PLR0915", | ||
# Misc | ||
"B008", | ||
"S101", | ||
] | ||
unfixable = [ | ||
# Don't touch unused imports | ||
|
@@ -155,15 +133,14 @@ branch = true | |
parallel = true | ||
|
||
[tool.coverage.paths] | ||
cohere_haystack = ["src/haystack_integrations", "*/cohere/src/haystack_integrations"] | ||
cohere_haystack = [ | ||
"src/haystack_integrations", | ||
"*/cohere/src/haystack_integrations", | ||
] | ||
tests = ["tests", "*/cohere/tests"] | ||
|
||
[tool.coverage.report] | ||
exclude_lines = [ | ||
"no cov", | ||
"if __name__ == .__main__.:", | ||
"if TYPE_CHECKING:", | ||
] | ||
exclude_lines = ["no cov", "if __name__ == .__main__.:", "if TYPE_CHECKING:"] | ||
|
||
[[tool.mypy.overrides]] | ||
module = [ | ||
|
@@ -184,4 +161,4 @@ markers = [ | |
"generators: generators tests", | ||
"chat_generators: chat_generators tests", | ||
] | ||
log_cli = true | ||
log_cli = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.