From a79dfce025746f4f9b767ab131e1258b81bb2e91 Mon Sep 17 00:00:00 2001 From: Massimiliano Pippi Date: Wed, 24 Jan 2024 17:56:12 +0100 Subject: [PATCH 01/10] ignore docs generation by-products --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 1815e02f8..6fd172e18 100644 --- a/.gitignore +++ b/.gitignore @@ -131,3 +131,6 @@ dmypy.json # IDEs .vscode + +# Docs generation artifacts +_readme_sync.md \ No newline at end of file From b6afe3a8b4db30d3136e888030a3cbc3225933ed Mon Sep 17 00:00:00 2001 From: Massimiliano Pippi Date: Wed, 24 Jan 2024 17:56:31 +0100 Subject: [PATCH 02/10] add pydoc config file --- integrations/chroma/pydoc.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 integrations/chroma/pydoc.yml diff --git a/integrations/chroma/pydoc.yml b/integrations/chroma/pydoc.yml new file mode 100644 index 000000000..810f33f03 --- /dev/null +++ b/integrations/chroma/pydoc.yml @@ -0,0 +1,31 @@ +loaders: + - type: haystack_pydoc_tools.loaders.CustomPythonLoader + search_path: [src] + modules: [ + "haystack_integrations.components.retrievers.chroma.retriever", + "haystack_integrations.document_stores.chroma.document_store", + "haystack_integrations.document_stores.chroma.errors", + "haystack_integrations.document_stores.chroma.utils", + ] + 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: Chroma integration for Haystack + category_slug: haystack-classes + title: Chroma + slug: integrations-chroma + order: 1 + markdown: + descriptive_class_title: false + descriptive_module_title: true + add_method_class_prefix: true + add_member_class_prefix: false + filename: _readme_sync.md From 2689a836297f597844b093edcd4ba73b7337ff19 Mon Sep 17 00:00:00 2001 From: Massimiliano Pippi Date: Wed, 24 Jan 2024 17:56:46 +0100 Subject: [PATCH 03/10] hatch run docs --- integrations/chroma/pyproject.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/integrations/chroma/pyproject.toml b/integrations/chroma/pyproject.toml index 2e531005b..a3bdc81d8 100644 --- a/integrations/chroma/pyproject.toml +++ b/integrations/chroma/pyproject.toml @@ -47,6 +47,7 @@ git_describe_command = 'git describe --tags --match="integrations/chroma-v[0-9]* dependencies = [ "coverage[toml]>=6.5", "pytest", + "haystack-pydoc-tools", ] [tool.hatch.envs.default.scripts] test = "pytest {args:tests}" @@ -59,6 +60,7 @@ cov = [ "test-cov", "cov-report", ] +docs = "pydoc-markdown pydoc.yml" [[tool.hatch.envs.all.matrix]] python = ["3.9", "3.10"] From 2fe4547b0b331beea1f32780ed7879c1ac9227d8 Mon Sep 17 00:00:00 2001 From: Massimiliano Pippi Date: Wed, 24 Jan 2024 18:05:54 +0100 Subject: [PATCH 04/10] generate docs as smoke test --- .github/workflows/chroma.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/chroma.yml b/.github/workflows/chroma.yml index 89b6a5b24..1593cbad9 100644 --- a/.github/workflows/chroma.yml +++ b/.github/workflows/chroma.yml @@ -48,9 +48,11 @@ jobs: - name: Install Hatch run: pip install --upgrade hatch - - name: Lint + - name: Lint and Docs if: matrix.python-version == '3.9' && runner.os == 'Linux' - run: hatch run lint:all + run: | + hatch run lint:all + hatch run docs - name: Run tests run: hatch run cov \ No newline at end of file From 86a1d5f3114b640f130248fceb389c71f8142db2 Mon Sep 17 00:00:00 2001 From: Massimiliano Pippi Date: Wed, 24 Jan 2024 18:09:02 +0100 Subject: [PATCH 05/10] split the steps for easier debugging --- .github/workflows/chroma.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/chroma.yml b/.github/workflows/chroma.yml index 1593cbad9..b7f158cfe 100644 --- a/.github/workflows/chroma.yml +++ b/.github/workflows/chroma.yml @@ -48,11 +48,13 @@ jobs: - name: Install Hatch run: pip install --upgrade hatch - - name: Lint and Docs + - name: Lint if: matrix.python-version == '3.9' && runner.os == 'Linux' - run: | - hatch run lint:all - hatch run docs + 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 + run: hatch run cov From 08eb6f1ee4813a40e11ef6b37ad797dc9939c4ad Mon Sep 17 00:00:00 2001 From: Massimiliano Pippi Date: Thu, 25 Jan 2024 15:23:35 +0100 Subject: [PATCH 06/10] split pydoc config --- .../{pydoc.yml => pydoc/document_stores.yml} | 7 ++--- integrations/chroma/pydoc/retrievers.yml | 28 +++++++++++++++++++ integrations/chroma/pyproject.toml | 5 +++- 3 files changed, 35 insertions(+), 5 deletions(-) rename integrations/chroma/{pydoc.yml => pydoc/document_stores.yml} (84%) create mode 100644 integrations/chroma/pydoc/retrievers.yml diff --git a/integrations/chroma/pydoc.yml b/integrations/chroma/pydoc/document_stores.yml similarity index 84% rename from integrations/chroma/pydoc.yml rename to integrations/chroma/pydoc/document_stores.yml index 810f33f03..942598581 100644 --- a/integrations/chroma/pydoc.yml +++ b/integrations/chroma/pydoc/document_stores.yml @@ -1,8 +1,7 @@ loaders: - type: haystack_pydoc_tools.loaders.CustomPythonLoader - search_path: [src] + search_path: [../src] modules: [ - "haystack_integrations.components.retrievers.chroma.retriever", "haystack_integrations.document_stores.chroma.document_store", "haystack_integrations.document_stores.chroma.errors", "haystack_integrations.document_stores.chroma.utils", @@ -21,11 +20,11 @@ renderer: excerpt: Chroma integration for Haystack category_slug: haystack-classes title: Chroma - slug: integrations-chroma + slug: integrations-chroma-document-stores order: 1 markdown: descriptive_class_title: false descriptive_module_title: true add_method_class_prefix: true add_member_class_prefix: false - filename: _readme_sync.md + filename: _readme_document_stores.md diff --git a/integrations/chroma/pydoc/retrievers.yml b/integrations/chroma/pydoc/retrievers.yml new file mode 100644 index 000000000..b20ca1e04 --- /dev/null +++ b/integrations/chroma/pydoc/retrievers.yml @@ -0,0 +1,28 @@ +loaders: + - type: haystack_pydoc_tools.loaders.CustomPythonLoader + search_path: [../src] + modules: [ + "haystack_integrations.components.retrievers.chroma.retriever", + ] + 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: Chroma integration for Haystack + category_slug: haystack-classes + title: Chroma + slug: integrations-chroma-retrievers + order: 1 + markdown: + descriptive_class_title: false + descriptive_module_title: true + add_method_class_prefix: true + add_member_class_prefix: false + filename: _readme_retrievers.md diff --git a/integrations/chroma/pyproject.toml b/integrations/chroma/pyproject.toml index a3bdc81d8..8281e5e59 100644 --- a/integrations/chroma/pyproject.toml +++ b/integrations/chroma/pyproject.toml @@ -60,7 +60,10 @@ cov = [ "test-cov", "cov-report", ] -docs = "pydoc-markdown pydoc.yml" +docs = [ + "pydoc-markdown pydoc/document_stores.yml", + "pydoc-markdown pydoc/retrievers.yml", +] [[tool.hatch.envs.all.matrix]] python = ["3.9", "3.10"] From 5513014faca5e396ad0c6f887f960fe3730c7b59 Mon Sep 17 00:00:00 2001 From: Massimiliano Pippi Date: Thu, 25 Jan 2024 15:24:04 +0100 Subject: [PATCH 07/10] update pydoc pattern --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 6fd172e18..86de4295c 100644 --- a/.gitignore +++ b/.gitignore @@ -133,4 +133,4 @@ dmypy.json .vscode # Docs generation artifacts -_readme_sync.md \ No newline at end of file +_readme_*.md \ No newline at end of file From 24bb33267d4b7c4c9a0fd788ebdc369075a71cf5 Mon Sep 17 00:00:00 2001 From: Massimiliano Pippi Date: Thu, 25 Jan 2024 16:24:06 +0100 Subject: [PATCH 08/10] single-page version --- .../pydoc/{document_stores.yml => config.yml} | 5 ++-- integrations/chroma/pydoc/retrievers.yml | 28 ------------------- integrations/chroma/pyproject.toml | 3 +- 3 files changed, 4 insertions(+), 32 deletions(-) rename integrations/chroma/pydoc/{document_stores.yml => config.yml} (86%) delete mode 100644 integrations/chroma/pydoc/retrievers.yml diff --git a/integrations/chroma/pydoc/document_stores.yml b/integrations/chroma/pydoc/config.yml similarity index 86% rename from integrations/chroma/pydoc/document_stores.yml rename to integrations/chroma/pydoc/config.yml index 942598581..29f7cf3d0 100644 --- a/integrations/chroma/pydoc/document_stores.yml +++ b/integrations/chroma/pydoc/config.yml @@ -2,6 +2,7 @@ loaders: - type: haystack_pydoc_tools.loaders.CustomPythonLoader search_path: [../src] modules: [ + "haystack_integrations.components.retrievers.chroma.retriever", "haystack_integrations.document_stores.chroma.document_store", "haystack_integrations.document_stores.chroma.errors", "haystack_integrations.document_stores.chroma.utils", @@ -20,11 +21,11 @@ renderer: excerpt: Chroma integration for Haystack category_slug: haystack-classes title: Chroma - slug: integrations-chroma-document-stores + slug: integrations-chroma order: 1 markdown: descriptive_class_title: false descriptive_module_title: true add_method_class_prefix: true add_member_class_prefix: false - filename: _readme_document_stores.md + filename: _readme_chroma.md diff --git a/integrations/chroma/pydoc/retrievers.yml b/integrations/chroma/pydoc/retrievers.yml deleted file mode 100644 index b20ca1e04..000000000 --- a/integrations/chroma/pydoc/retrievers.yml +++ /dev/null @@ -1,28 +0,0 @@ -loaders: - - type: haystack_pydoc_tools.loaders.CustomPythonLoader - search_path: [../src] - modules: [ - "haystack_integrations.components.retrievers.chroma.retriever", - ] - 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: Chroma integration for Haystack - category_slug: haystack-classes - title: Chroma - slug: integrations-chroma-retrievers - order: 1 - markdown: - descriptive_class_title: false - descriptive_module_title: true - add_method_class_prefix: true - add_member_class_prefix: false - filename: _readme_retrievers.md diff --git a/integrations/chroma/pyproject.toml b/integrations/chroma/pyproject.toml index 8281e5e59..ce4641611 100644 --- a/integrations/chroma/pyproject.toml +++ b/integrations/chroma/pyproject.toml @@ -61,8 +61,7 @@ cov = [ "cov-report", ] docs = [ - "pydoc-markdown pydoc/document_stores.yml", - "pydoc-markdown pydoc/retrievers.yml", + "pydoc-markdown pydoc/config.yml" ] [[tool.hatch.envs.all.matrix]] From 32003f64717e9b4f775576084e6d7916eee94fcf Mon Sep 17 00:00:00 2001 From: Massimiliano Pippi Date: Thu, 25 Jan 2024 16:25:42 +0100 Subject: [PATCH 09/10] newline --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 86de4295c..8634bc259 100644 --- a/.gitignore +++ b/.gitignore @@ -133,4 +133,4 @@ dmypy.json .vscode # Docs generation artifacts -_readme_*.md \ No newline at end of file +_readme_*.md From 46f7260fdedf4bd39746831c2f42a421a070d114 Mon Sep 17 00:00:00 2001 From: Daria Fokina Date: Thu, 25 Jan 2024 17:14:13 +0100 Subject: [PATCH 10/10] upd parent category --- integrations/chroma/pydoc/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integrations/chroma/pydoc/config.yml b/integrations/chroma/pydoc/config.yml index 29f7cf3d0..fd362d7e0 100644 --- a/integrations/chroma/pydoc/config.yml +++ b/integrations/chroma/pydoc/config.yml @@ -19,7 +19,7 @@ processors: renderer: type: haystack_pydoc_tools.renderers.ReadmePreviewRenderer excerpt: Chroma integration for Haystack - category_slug: haystack-classes + category_slug: haystack-integrations title: Chroma slug: integrations-chroma order: 1