-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev/fastembed' into dev/fastembed_fix
- Loading branch information
Showing
47 changed files
with
1,682 additions
and
267 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
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 |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: Core / Sync docs with Readme | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
sync: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout this repo | ||
uses: actions/checkout@v4 | ||
with: | ||
# This will tell tj-actions/changed-files to compare the current pushed commit with the latest in main | ||
fetch-depth: 0 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -U haystack-pydoc-tools hatch | ||
# We look into the changeset in order to understand | ||
# which integrations were modified by the last commit. | ||
- name: Get changed files | ||
id: changed-files | ||
uses: tj-actions/changed-files@v42 | ||
with: | ||
files: integrations/** | ||
# Output unique changed directories instead of filenames | ||
dir_names: true | ||
# We only care about the name of the integration, i.e. integrations/FOO | ||
dir_names_max_depth: 2 | ||
|
||
- name: Generate docs | ||
if: steps.changed-files.outputs.all_changed_files != '' | ||
env: | ||
# This is necessary to fetch the documentation categories | ||
# from Readme.io as we need them to associate the slug | ||
# in config files with their id. | ||
README_API_KEY: ${{ secrets.README_API_KEY }} | ||
ALL_CHANGED_DIRS: ${{ steps.changed-files.outputs.all_changed_files }} | ||
run: | | ||
for d in $ALL_CHANGED_DIRS; do | ||
cd $d | ||
hatch run docs | ||
cd - | ||
done | ||
mkdir tmp | ||
find . -name "_readme_*.md" -exec cp "{}" tmp \; | ||
ls tmp | ||
- name: Sync preview docs with 2.0 | ||
if: steps.changed-files.outputs.all_changed_files != '' | ||
uses: readmeio/[email protected] | ||
env: | ||
README_API_KEY: ${{ secrets.README_API_KEY }} | ||
with: | ||
rdme: docs ./tmp --key="$README_API_KEY" --version=2.0 |
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 |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# This workflow comes from https://github.com/ofek/hatch-mypyc | ||
# https://github.com/ofek/hatch-mypyc/blob/5a198c0ba8660494d02716cfc9d79ce4adfb1442/.github/workflows/test.yml | ||
name: Test / deepeval | ||
|
||
on: | ||
schedule: | ||
- cron: "0 0 * * *" | ||
pull_request: | ||
paths: | ||
- "integrations/deepeval/**" | ||
- ".github/workflows/deepeval.yml" | ||
|
||
defaults: | ||
run: | ||
working-directory: integrations/deepeval | ||
|
||
concurrency: | ||
group: deepeval-${{ github.head_ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
PYTHONUNBUFFERED: "1" | ||
FORCE_COLOR: "1" | ||
|
||
jobs: | ||
run: | ||
name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
python-version: ["3.9", "3.10"] | ||
|
||
steps: | ||
- name: Support longpaths | ||
if: matrix.os == 'windows-latest' | ||
working-directory: . | ||
run: git config --system core.longpaths true | ||
|
||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install Hatch | ||
run: pip install --upgrade hatch | ||
|
||
- name: Lint | ||
if: matrix.python-version == '3.9' && runner.os == 'Linux' | ||
run: hatch run lint:all | ||
|
||
- name: Generate docs | ||
if: matrix.python-version == '3.9' && runner.os == 'Linux' | ||
run: hatch run docs | ||
|
||
- name: Run tests | ||
run: hatch run cov |
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
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
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 |
Oops, something went wrong.