diff --git a/.github/workflows/gradient.yml b/.github/workflows/gradient.yml index 8bab11d39..61a04be7b 100644 --- a/.github/workflows/gradient.yml +++ b/.github/workflows/gradient.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/gradient/pydoc/config.yml b/integrations/gradient/pydoc/config.yml new file mode 100644 index 000000000..6ffae5f28 --- /dev/null +++ b/integrations/gradient/pydoc/config.yml @@ -0,0 +1,30 @@ +loaders: + - type: haystack_pydoc_tools.loaders.CustomPythonLoader + search_path: [../src] + modules: [ + "haystack_integrations.components.embedders.gradient.gradient_document_embedder", + "haystack_integrations.components.embedders.gradient.gradient_text_embedder", + "haystack_integrations.components.generators.gradient.base", + ] + 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: Gradient + slug: integrations-gradient + order: 80 + markdown: + descriptive_class_title: false + descriptive_module_title: true + add_method_class_prefix: true + add_member_class_prefix: false + filename: _readme_gradient.md \ No newline at end of file diff --git a/integrations/gradient/pyproject.toml b/integrations/gradient/pyproject.toml index 22140bba5..51919f149 100644 --- a/integrations/gradient/pyproject.toml +++ b/integrations/gradient/pyproject.toml @@ -52,6 +52,7 @@ git_describe_command = 'git describe --tags --match="integrations/gradient-v[0-9 dependencies = [ "coverage[toml]>=6.5", "pytest", + "haystack-pydoc-tools", ] [tool.hatch.envs.default.scripts] test = "pytest {args:tests}" @@ -64,7 +65,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"]