From 61daacb3f9e63af8f9df67cada8288ad333ad074 Mon Sep 17 00:00:00 2001 From: ZanSara Date: Thu, 1 Feb 2024 15:14:29 +0100 Subject: [PATCH] add pydocconf (#321) --- .github/workflows/cohere.yml | 4 ++++ integrations/cohere/pydoc/config.yml | 32 ++++++++++++++++++++++++++++ integrations/cohere/pyproject.toml | 4 ++++ 3 files changed, 40 insertions(+) create mode 100644 integrations/cohere/pydoc/config.yml diff --git a/.github/workflows/cohere.yml b/.github/workflows/cohere.yml index 0f0030ec1..562556e47 100644 --- a/.github/workflows/cohere.yml +++ b/.github/workflows/cohere.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 diff --git a/integrations/cohere/pydoc/config.yml b/integrations/cohere/pydoc/config.yml new file mode 100644 index 000000000..9418739b5 --- /dev/null +++ b/integrations/cohere/pydoc/config.yml @@ -0,0 +1,32 @@ +loaders: + - type: haystack_pydoc_tools.loaders.CustomPythonLoader + search_path: [../src] + modules: [ + "haystack_integrations.components.embedders.cohere.document_embedder", + "haystack_integrations.components.embedders.cohere.text_embedder", + "haystack_integrations.components.embedders.cohere.utils", + "haystack_integrations.components.generators.cohere.generator", + "haystack_integrations.components.generators.cohere.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: Cohere integration for Haystack + category_slug: haystack-integrations + title: Cohere + slug: integrations-cohere + order: 40 + markdown: + descriptive_class_title: false + descriptive_module_title: true + add_method_class_prefix: true + add_member_class_prefix: false + filename: _readme_cohere.md diff --git a/integrations/cohere/pyproject.toml b/integrations/cohere/pyproject.toml index 42349d9fb..332471674 100644 --- a/integrations/cohere/pyproject.toml +++ b/integrations/cohere/pyproject.toml @@ -49,6 +49,7 @@ git_describe_command = 'git describe --tags --match="integrations/cohere-v[0-9]* dependencies = [ "coverage[toml]>=6.5", "pytest", + "haystack-pydoc-tools", ] [tool.hatch.envs.default.scripts] test = "pytest {args:tests}" @@ -61,6 +62,9 @@ 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"]