Skip to content

Commit

Permalink
ci: Generate API docs for Qdrant (#361)
Browse files Browse the repository at this point in the history
  • Loading branch information
shadeMe authored Feb 8, 2024
1 parent dd92c1b commit ff122ab
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 62 deletions.
42 changes: 23 additions & 19 deletions .github/workflows/qdrant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ on:
- cron: "0 0 * * *"
pull_request:
paths:
- 'integrations/qdrant/**'
- '.github/workflows/qdrant.yml'
- "integrations/qdrant/**"
- ".github/workflows/qdrant.yml"

defaults:
run:
Expand All @@ -30,27 +30,31 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.9', '3.10']
python-version: ["3.9", "3.10"]

steps:
- name: Support longpaths
if: matrix.os == 'windows-latest'
working-directory: .
run: git config --system core.longpaths true
- name: Support longpaths
if: matrix.os == 'windows-latest'
working-directory: .
run: git config --system core.longpaths true

- uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install Hatch
run: pip install --upgrade hatch
- name: Install Hatch
run: pip install --upgrade hatch

- name: Lint
if: matrix.python-version == '3.9' && runner.os == 'Linux'
run: hatch run lint:all
- name: Lint
if: matrix.python-version == '3.9' && runner.os == 'Linux'
run: hatch run lint:all

- name: Run tests
run: hatch run cov
- name: Generate docs
if: matrix.python-version == '3.9' && runner.os == 'Linux'
run: hatch run docs

- name: Run tests
run: hatch run cov
32 changes: 32 additions & 0 deletions integrations/qdrant/pydoc/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
loaders:
- type: haystack_pydoc_tools.loaders.CustomPythonLoader
search_path: [../src]
modules:
[
"haystack_integrations.components.retrievers.qdrant.retriever",
"haystack_integrations.document_stores.qdrant.document_store",
"haystack_integrations.document_stores.qdrant.converters",
"haystack_integrations.document_stores.qdrant.filters",
]
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: Qdrant integration for Haystack
category_slug: haystack-integrations
title: Qdrant
slug: integrations-qdrant
order: 160
markdown:
descriptive_class_title: false
descriptive_module_title: true
add_method_class_prefix: true
add_member_class_prefix: false
filename: _readme_qdrant.md
66 changes: 23 additions & 43 deletions integrations/qdrant/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@ classifiers = [
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]
dependencies = [
"haystack-ai",
"qdrant-client",
]
dependencies = ["haystack-ai", "qdrant-client"]

[project.urls]
Source = "https://github.com/deepset-ai/haystack-core-integrations"
Expand All @@ -47,47 +44,25 @@ root = "../.."
git_describe_command = 'git describe --tags --match="integrations/qdrant-v[0-9]*"'

[tool.hatch.envs.default]
dependencies = [
"coverage[toml]>=6.5",
"pytest",
]
dependencies = ["coverage[toml]>=6.5", "pytest", "haystack-pydoc-tools"]
[tool.hatch.envs.default.scripts]
test = "pytest {args:tests}"
test-cov = "coverage run -m pytest {args:tests}"
cov-report = [
"- coverage combine",
"coverage report",
]
cov = [
"test-cov",
"cov-report",
]
cov-report = ["- coverage combine", "coverage report"]
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"]

[tool.hatch.envs.lint]
detached = true
dependencies = [
"black>=23.1.0",
"mypy>=1.0.0",
"ruff>=0.0.243",
]
dependencies = ["black>=23.1.0", "mypy>=1.0.0", "ruff>=0.0.243"]
[tool.hatch.envs.lint.scripts]
typing = "mypy --install-types --non-interactive --explicit-package-bases {args:src/ tests}"
style = [
"ruff {args:.}",
"black --check --diff {args:.}",
]
fmt = [
"black {args:.}",
"ruff --fix {args:.}",
"style",
]
all = [
"style",
"typing",
]
style = ["ruff {args:.}", "black --check --diff {args:.}"]
fmt = ["black {args:.}", "ruff --fix {args:.}", "style"]
all = ["style", "typing"]

[tool.black]
target-version = ["py37"]
Expand Down Expand Up @@ -130,9 +105,15 @@ ignore = [
# Allow boolean positional values in function calls, like `dict.get(... True)`
"FBT003",
# Ignore checks for possible passwords
"S105", "S106", "S107",
"S105",
"S106",
"S107",
# Ignore complexity
"C901", "PLR0911", "PLR0912", "PLR0913", "PLR0915",
"C901",
"PLR0911",
"PLR0912",
"PLR0913",
"PLR0915",
]
unfixable = [
# Don't touch unused imports
Expand All @@ -153,15 +134,14 @@ parallel = true


[tool.coverage.paths]
qdrant_haystack = ["src/qdrant_haystack", "*/qdrant-haystack/src/qdrant_haystack"]
qdrant_haystack = [
"src/qdrant_haystack",
"*/qdrant-haystack/src/qdrant_haystack",
]
tests = ["tests", "*/qdrant-haystack/tests"]

[tool.coverage.report]
exclude_lines = [
"no cov",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
]
exclude_lines = ["no cov", "if __name__ == .__main__.:", "if TYPE_CHECKING:"]

[[tool.mypy.overrides]]
module = [
Expand All @@ -170,6 +150,6 @@ module = [
"pytest.*",
"qdrant_client.*",
"numpy",
"grpc"
"grpc",
]
ignore_missing_imports = true

0 comments on commit ff122ab

Please sign in to comment.