Skip to content

Commit

Permalink
opensearch: generate API docs (#324)
Browse files Browse the repository at this point in the history
  • Loading branch information
anakin87 authored Feb 2, 2024
1 parent d477a21 commit 8c96def
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 2 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/opensearch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ env:
PYTHONUNBUFFERED: "1"
FORCE_COLOR: "1"

defaults:
run:
working-directory: integrations/opensearch

jobs:
run:
name: Python ${{ matrix.python-version }} on ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }}
Expand All @@ -40,14 +44,16 @@ jobs:
run: pip install --upgrade hatch

- name: Lint
working-directory: integrations/opensearch
if: matrix.python-version == '3.9'
run: hatch run lint:all

- name: Run opensearch container
working-directory: integrations/opensearch
run: docker-compose up -d

- name: Generate docs
if: matrix.python-version == '3.9' && runner.os == 'Linux'
run: hatch run docs

- name: Run tests
working-directory: integrations/opensearch
run: hatch run cov
31 changes: 31 additions & 0 deletions integrations/opensearch/pydoc/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
loaders:
- type: haystack_pydoc_tools.loaders.CustomPythonLoader
search_path: [../src]
modules: [
"haystack_integrations.components.retrievers.opensearch.bm25_retriever",
"haystack_integrations.components.retrievers.opensearch.embedding_retriever",
"haystack_integrations.document_stores.opensearch.document_store",
"haystack_integrations.document_stores.opensearch.filters",
]
ignore_when_discovered: ["__init__"]
processors:
- type: filter
expression:
documented_only: true
do_not_filter_modules: false
skip_empty_modules: true
- type: smart
- type: crossref
renderer:
type: haystack_pydoc_tools.renderers.ReadmePreviewRenderer
excerpt: OpenSearch integration for Haystack
category_slug: haystack-integrations
title: OpenSearch
slug: integrations-opensearch
order: 130
markdown:
descriptive_class_title: false
descriptive_module_title: true
add_method_class_prefix: true
add_member_class_prefix: false
filename: _readme_opensearch.md
5 changes: 5 additions & 0 deletions integrations/opensearch/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ dependencies = [
"coverage[toml]>=6.5",
"pytest",
"pytest-xdist",
"haystack-pydoc-tools",
]
[tool.hatch.envs.default.scripts]
test = "pytest {args:tests}"
Expand All @@ -62,6 +63,10 @@ cov = [
"cov-report",
]

docs = [
"pydoc-markdown pydoc/config.yml"
]

[[tool.hatch.envs.all.matrix]]
python = ["3.8", "3.9", "3.10", "3.11"]

Expand Down

0 comments on commit 8c96def

Please sign in to comment.