From f86c758f8dedd09f2dfc3f0fd126691881b4aacb Mon Sep 17 00:00:00 2001 From: Daria Fokina Date: Wed, 7 Feb 2024 17:37:57 +0100 Subject: [PATCH] google_vertex: create api docs (#355) --- .github/workflows/google_vertex.yml | 4 +++ integrations/google_vertex/pydoc/config.yml | 34 +++++++++++++++++++++ integrations/google_vertex/pyproject.toml | 5 ++- 3 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 integrations/google_vertex/pydoc/config.yml diff --git a/.github/workflows/google_vertex.yml b/.github/workflows/google_vertex.yml index cf60d3229..6f6c6d0d9 100644 --- a/.github/workflows/google_vertex.yml +++ b/.github/workflows/google_vertex.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 diff --git a/integrations/google_vertex/pydoc/config.yml b/integrations/google_vertex/pydoc/config.yml new file mode 100644 index 000000000..86d0f3b52 --- /dev/null +++ b/integrations/google_vertex/pydoc/config.yml @@ -0,0 +1,34 @@ +loaders: + - type: haystack_pydoc_tools.loaders.CustomPythonLoader + search_path: [../src] + modules: [ + "haystack_integrations.components.generators.google_vertex.gemini", + "haystack_integrations.components.generators.google_vertex.captioner", + "haystack_integrations.components.generators.google_vertex.code_generator", + "haystack_integrations.components.generators.google_vertex.image_generator", + "haystack_integrations.components.generators.google_vertex.question_answering", + "haystack_integrations.components.generators.google_vertex.text_generator", + "haystack_integrations.components.generators.google_vertex.chat.gemini", + ] + 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: Google Vertex integration for Haystack + category_slug: haystack-integrations + title: Google Vertex + slug: integrations-google-vertex + order: 70 + markdown: + descriptive_class_title: false + descriptive_module_title: true + add_method_class_prefix: true + add_member_class_prefix: false + filename: _readme_google_vertex.md \ No newline at end of file diff --git a/integrations/google_vertex/pyproject.toml b/integrations/google_vertex/pyproject.toml index ecd509f15..f846d5bc4 100644 --- a/integrations/google_vertex/pyproject.toml +++ b/integrations/google_vertex/pyproject.toml @@ -48,6 +48,7 @@ git_describe_command = 'git describe --tags --match="integrations/google_vertex- dependencies = [ "coverage[toml]>=6.5", "pytest", + "haystack-pydoc-tools", ] [tool.hatch.envs.default.scripts] test = "pytest {args:tests}" @@ -60,7 +61,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"]