diff --git a/.github/workflows/ollama.yml b/.github/workflows/ollama.yml index 7f61af14e..a375fc7db 100644 --- a/.github/workflows/ollama.yml +++ b/.github/workflows/ollama.yml @@ -54,6 +54,11 @@ jobs: - name: Pull the LLM in the Ollama service run: docker exec ollama ollama pull ${{ env.LLM_FOR_TESTS }} + - name: Generate docs + working-directory: integrations/ollama + if: matrix.python-version == '3.9' && runner.os == 'Linux' + run: hatch run docs + - name: Run tests working-directory: integrations/ollama run: hatch run cov diff --git a/integrations/ollama/pydoc/config.yml b/integrations/ollama/pydoc/config.yml new file mode 100644 index 000000000..768694991 --- /dev/null +++ b/integrations/ollama/pydoc/config.yml @@ -0,0 +1,29 @@ +loaders: + - type: haystack_pydoc_tools.loaders.CustomPythonLoader + search_path: [../src] + modules: [ + "haystack_integrations.components.generators.ollama.generator", + "haystack_integrations.components.generators.ollama.chat.chat_generator" + ] + 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: Ollama integration for Haystack + category_slug: haystack-integrations + title: Ollama + slug: integrations-ollama + order: 120 + markdown: + descriptive_class_title: false + descriptive_module_title: true + add_method_class_prefix: true + add_member_class_prefix: false + filename: _readme_ollama.md \ No newline at end of file diff --git a/integrations/ollama/pyproject.toml b/integrations/ollama/pyproject.toml index 69cc2ed16..e3bb738b6 100644 --- a/integrations/ollama/pyproject.toml +++ b/integrations/ollama/pyproject.toml @@ -48,6 +48,7 @@ git_describe_command = 'git describe --tags --match="integrations/ollama-v[0-9]* dependencies = [ "coverage[toml]>=6.5", "pytest", + "haystack-pydoc-tools", ] [tool.hatch.envs.default.scripts] test = "pytest {args:tests}" @@ -60,6 +61,9 @@ cov = [ "test-cov", "cov-report", ] +docs = [ + "pydoc-markdown pydoc/config.yml" +] [[tool.hatch.envs.all.matrix]] python = ["3.8", "3.9", "3.10", "3.11", "3.12"]