diff --git a/.github/workflows/unstructured.yml b/.github/workflows/unstructured.yml index 77ebb10ca..d12bf4daf 100644 --- a/.github/workflows/unstructured.yml +++ b/.github/workflows/unstructured.yml @@ -8,7 +8,7 @@ on: pull_request: paths: - "integrations/unstructured/**" - - ".github/workflows/unstructured.yml" + - ".github/workflows/unstructured.yml" concurrency: group: unstructured-${{ github.head_ref }} @@ -59,6 +59,11 @@ jobs: if: matrix.python-version == '3.9' run: hatch run lint:all + - name: Generate docs + working-directory: integrations/unstructured + if: matrix.python-version == '3.9' && runner.os == 'Linux' + run: hatch run docs + - name: Run tests - working-directory: integrations/unstructured + working-directory: integrations/unstructured run: hatch run cov diff --git a/integrations/unstructured/pydoc/config.yml b/integrations/unstructured/pydoc/config.yml new file mode 100644 index 000000000..77c17fac6 --- /dev/null +++ b/integrations/unstructured/pydoc/config.yml @@ -0,0 +1,28 @@ +loaders: + - type: haystack_pydoc_tools.loaders.CustomPythonLoader + search_path: [../src] + modules: [ + "haystack_integrations.components.converters.unstructured.converter", + ] + 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: Unstructured integration for Haystack + category_slug: haystack-integrations + title: Unstructured + slug: integrations-unstructured + order: 170 + markdown: + descriptive_class_title: false + descriptive_module_title: true + add_method_class_prefix: true + add_member_class_prefix: false + filename: _readme_unstructured.md diff --git a/integrations/unstructured/pyproject.toml b/integrations/unstructured/pyproject.toml index 9cc2a0c6a..7366a8adf 100644 --- a/integrations/unstructured/pyproject.toml +++ b/integrations/unstructured/pyproject.toml @@ -49,6 +49,7 @@ dependencies = [ "coverage[toml]>=6.5", "pytest", "pytest-xdist", + "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.8", "3.9", "3.10", "3.11"]