diff --git a/.github/workflows/chroma.yml b/.github/workflows/chroma.yml index 89b6a5b24..b7f158cfe 100644 --- a/.github/workflows/chroma.yml +++ b/.github/workflows/chroma.yml @@ -52,5 +52,9 @@ jobs: 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 \ No newline at end of file + run: hatch run cov diff --git a/.gitignore b/.gitignore index 1815e02f8..8634bc259 100644 --- a/.gitignore +++ b/.gitignore @@ -131,3 +131,6 @@ dmypy.json # IDEs .vscode + +# Docs generation artifacts +_readme_*.md diff --git a/integrations/chroma/pydoc/config.yml b/integrations/chroma/pydoc/config.yml new file mode 100644 index 000000000..fd362d7e0 --- /dev/null +++ b/integrations/chroma/pydoc/config.yml @@ -0,0 +1,31 @@ +loaders: + - type: haystack_pydoc_tools.loaders.CustomPythonLoader + search_path: [../src] + modules: [ + "haystack_integrations.components.retrievers.chroma.retriever", + "haystack_integrations.document_stores.chroma.document_store", + "haystack_integrations.document_stores.chroma.errors", + "haystack_integrations.document_stores.chroma.utils", + ] + 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: Chroma integration for Haystack + category_slug: haystack-integrations + title: Chroma + slug: integrations-chroma + order: 1 + markdown: + descriptive_class_title: false + descriptive_module_title: true + add_method_class_prefix: true + add_member_class_prefix: false + filename: _readme_chroma.md diff --git a/integrations/chroma/pyproject.toml b/integrations/chroma/pyproject.toml index 2e531005b..ce4641611 100644 --- a/integrations/chroma/pyproject.toml +++ b/integrations/chroma/pyproject.toml @@ -47,6 +47,7 @@ git_describe_command = 'git describe --tags --match="integrations/chroma-v[0-9]* dependencies = [ "coverage[toml]>=6.5", "pytest", + "haystack-pydoc-tools", ] [tool.hatch.envs.default.scripts] test = "pytest {args:tests}" @@ -59,6 +60,9 @@ cov = [ "test-cov", "cov-report", ] +docs = [ + "pydoc-markdown pydoc/config.yml" +] [[tool.hatch.envs.all.matrix]] python = ["3.9", "3.10"]