Skip to content

Commit ca5f199

Browse files
bors[bot]kaggrwalkumar
authored
Merge #546
546: #462 python hosted documentation r=alallema a=kaggrwal # Pull Request ## Related issue Fixes #462 ## What does this PR do? - ... ## PR checklist Please check if your PR fulfills the following requirements: - [✓ ] Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)? - [ ✓] Have you read the contributing guidelines? - [ ✓] Have you made sure that the title is accurate and descriptive of the changes? Thank you so much for contributing to Meilisearch! Co-authored-by: Kumar Aggarrwal <[email protected]> Co-authored-by: kumar <[email protected]>
2 parents c104f2b + 304b9d4 commit ca5f199

File tree

10 files changed

+292
-3
lines changed

10 files changed

+292
-3
lines changed

.github/workflows/documentation.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Documentation
2+
on:
3+
push:
4+
tags:
5+
- v*
6+
7+
jobs:
8+
docs:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
with:
13+
fetch-depth: 0
14+
lfs: true
15+
- name: Install Python
16+
uses: actions/setup-python@v2
17+
with:
18+
python-version: '3.10'
19+
- name: Install pipenv
20+
uses: dschep/install-pipenv-action@v1
21+
- name: Install dependencies
22+
run: pipenv install --dev
23+
- name: Build docs
24+
uses: ammaraskar/sphinx-action@master
25+
with:
26+
pre-build-command: "pip install sphinx_rtd_theme && sphinx-apidoc -f -o docs meilisearch/"
27+
docs-folder: "docs/"
28+
- name: Deploy
29+
uses: peaceiris/actions-gh-pages@v3
30+
with:
31+
github_token: ${{ secrets.GITHUB_TOKEN }}
32+
publish_dir: docs/_build/html
33+
force_orphan: true
34+
35+
36+
37+
38+
39+
40+
41+
42+
43+
44+
45+

docs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = .
9+
BUILDDIR = _build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/conf.py

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# This file only contains a selection of the most common options. For a full
4+
# list see the documentation:
5+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
6+
7+
# -- Path setup --------------------------------------------------------------
8+
9+
# If extensions (or modules to document with autodoc) are in another directory,
10+
# add these directories to sys.path here. If the directory is relative to the
11+
# documentation root, use os.path.abspath to make it absolute, like shown here.
12+
#
13+
import os
14+
import sys
15+
sys.path.insert(0, os.path.abspath('..'))
16+
17+
# -- Project information -----------------------------------------------------
18+
19+
project = 'meilisearch-python'
20+
copyright = '2019, Meili SAS'
21+
author = 'Charlotte Vermandel'
22+
23+
24+
# -- General configuration ---------------------------------------------------
25+
26+
# Add any Sphinx extension module names here, as strings. They can be
27+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
28+
# ones.
29+
extensions = [
30+
'sphinx.ext.autodoc',
31+
'sphinx.ext.napoleon',
32+
'sphinx.ext.viewcode',
33+
]
34+
35+
# Add any paths that contain templates here, relative to this directory.
36+
templates_path = ['_templates']
37+
38+
# List of patterns, relative to source directory, that match files and
39+
# directories to ignore when looking for source files.
40+
# This pattern also affects html_static_path and html_extra_path.
41+
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
42+
43+
44+
# -- Options for HTML output -------------------------------------------------
45+
46+
# The theme to use for HTML and HTML Help pages. See the documentation for
47+
# a list of builtin themes.
48+
#
49+
html_theme = 'sphinx_rtd_theme'
50+
#html_theme = 'alabaster'
51+
52+
# Add any paths that contain custom static files (such as style sheets) here,
53+
# relative to this directory. They are copied after the builtin static files,
54+
# so a file named "default.css" will overwrite the builtin "default.css".
55+
html_static_path = []

docs/index.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
.. meilisearch-python documentation master file, created by
2+
sphinx-quickstart on Sun Oct 2 13:24:48 2022.
3+
You can adapt this file completely to your liking, but it should at least
4+
contain the root `toctree` directive.
5+
6+
Welcome to meilisearch-python's documentation!
7+
==============================================
8+
9+
.. toctree::
10+
:maxdepth: 2
11+
:caption: Contents:
12+
13+
14+
15+
.. include:: modules.rst
16+
17+
Indices and tables
18+
==================
19+
20+
* :ref:`genindex`
21+
* :ref:`modindex`
22+
* :ref:`search`

docs/make.bat

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@ECHO OFF
2+
3+
pushd %~dp0
4+
5+
REM Command file for Sphinx documentation
6+
7+
if "%SPHINXBUILD%" == "" (
8+
set SPHINXBUILD=sphinx-build
9+
)
10+
set SOURCEDIR=.
11+
set BUILDDIR=_build
12+
13+
if "%1" == "" goto help
14+
15+
%SPHINXBUILD% >NUL 2>NUL
16+
if errorlevel 9009 (
17+
echo.
18+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
19+
echo.installed, then set the SPHINXBUILD environment variable to point
20+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
21+
echo.may add the Sphinx directory to PATH.
22+
echo.
23+
echo.If you don't have Sphinx installed, grab it from
24+
echo.https://www.sphinx-doc.org/
25+
exit /b 1
26+
)
27+
28+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29+
goto end
30+
31+
:help
32+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33+
34+
:end
35+
popd

docs/meilisearch.models.rst

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
meilisearch.models package
2+
==========================
3+
4+
Submodules
5+
----------
6+
7+
meilisearch.models.document module
8+
----------------------------------
9+
10+
.. automodule:: meilisearch.models.document
11+
:members:
12+
:undoc-members:
13+
:show-inheritance:
14+
15+
meilisearch.models.index module
16+
-------------------------------
17+
18+
.. automodule:: meilisearch.models.index
19+
:members:
20+
:undoc-members:
21+
:show-inheritance:
22+
23+
meilisearch.models.task module
24+
------------------------------
25+
26+
.. automodule:: meilisearch.models.task
27+
:members:
28+
:undoc-members:
29+
:show-inheritance:
30+
31+
Module contents
32+
---------------
33+
34+
.. automodule:: meilisearch.models
35+
:members:
36+
:undoc-members:
37+
:show-inheritance:

docs/meilisearch.rst

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
meilisearch package
2+
===================
3+
4+
Subpackages
5+
-----------
6+
7+
.. toctree::
8+
:maxdepth: 4
9+
10+
meilisearch.models
11+
12+
Submodules
13+
----------
14+
15+
meilisearch.client module
16+
-------------------------
17+
18+
.. automodule:: meilisearch.client
19+
:members:
20+
:undoc-members:
21+
:show-inheritance:
22+
23+
meilisearch.config module
24+
-------------------------
25+
26+
.. automodule:: meilisearch.config
27+
:members:
28+
:undoc-members:
29+
:show-inheritance:
30+
31+
meilisearch.errors module
32+
-------------------------
33+
34+
.. automodule:: meilisearch.errors
35+
:members:
36+
:undoc-members:
37+
:show-inheritance:
38+
39+
meilisearch.index module
40+
------------------------
41+
42+
.. automodule:: meilisearch.index
43+
:members:
44+
:undoc-members:
45+
:show-inheritance:
46+
47+
meilisearch.task module
48+
-----------------------
49+
50+
.. automodule:: meilisearch.task
51+
:members:
52+
:undoc-members:
53+
:show-inheritance:
54+
55+
meilisearch.version module
56+
--------------------------
57+
58+
.. automodule:: meilisearch.version
59+
:members:
60+
:undoc-members:
61+
:show-inheritance:
62+
63+
Module contents
64+
---------------
65+
66+
.. automodule:: meilisearch
67+
:members:
68+
:undoc-members:
69+
:show-inheritance:

docs/modules.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
meilisearch
2+
===========
3+
4+
.. toctree::
5+
:maxdepth: 4
6+
7+
meilisearch

meilisearch/client.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,6 @@ def update_key(
327327
"""Update an API key.
328328
329329
Parameters
330-
331330
----------
332331
key:
333332
The key or the uid of the key for which to update the information.

meilisearch/index.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ def get_tasks(self, parameters: dict[str, Any] | None = None) -> TaskResults:
143143
-------
144144
tasks:
145145
TaskResults instance with attributes:
146-
- from_
147-
- next_
146+
- from
147+
- next
148148
- limit
149149
- results : list of Task instances containing all enqueued, processing, succeeded or failed tasks of the index
150150

0 commit comments

Comments
 (0)