Skip to content

Commit

Permalink
adds readthedocs config and output (#86)
Browse files Browse the repository at this point in the history
* wip

* adds readthedocs
  • Loading branch information
m00sey authored Aug 9, 2023
1 parent dd342a7 commit 4224e1c
Show file tree
Hide file tree
Showing 21 changed files with 343 additions and 9 deletions.
29 changes: 29 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the version of Python and other tools you might need
build:
os: ubuntu-20.04
apt_packages:
- libsodium23
tools:
python: "3.10"
# You can also specify other tool versions:
# nodejs: "16"
# rust: "1.55"
# golang: "1.17"

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py
builder: dirhtml

# Optionally declare the Python requirements required to build your docs
python:
install:
- requirements: requirements.txt
- requirements: docs/requirements.txt
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
46 changes: 46 additions & 0 deletions docs/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
KERIA
=====

|GitHub Actions| |codecov|

KERI Agent in the cloud

Split from KERI Core

Development
-----------

Setup
~~~~~

- Ensure `Python <https://www.python.org/downloads/>`__
``version 3.10.4+`` is installed
- Install `Keripy
dependency <https://github.com/WebOfTrust/keripy#dependencies>`__
(``libsodium 1.0.18+``)

Build from source
^^^^^^^^^^^^^^^^^

- Setup virtual environment: ``bash python3 -m venv venv``
- Activate virtual environment: ``bash source venv/bin/activate``
- Install dependencies: ``bash pip install -r requirements.txt``
- Run agent:
``bash keria start --config-dir scripts --config-file demo-witness-oobis``

Build with docker
^^^^^^^^^^^^^^^^^

- Build KERIA docker image: ``bash make build-keria``

Running Tests
~~~~~~~~~~~~~

- Install ``pytest``: ``bash pip install pytest``

- Run the test suites: ``bash pytest tests/``

.. |GitHub Actions| image:: https://github.com/webOfTrust/keria/actions/workflows/python-app-ci.yml/badge.svg
:target: https://github.com/WebOfTrust/keria/actions
.. |codecov| image:: https://codecov.io/gh/WebOfTrust/keria/branch/main/graph/badge.svg?token=FR5CB2TPYG
:target: https://codecov.io/gh/WebOfTrust/keria
54 changes: 54 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

import os
import sys

sys.path.insert(0, os.path.abspath(os.path.join("..", "src")))
import keria #noqa: E402

try:
import sphinx_rtd_theme
except ImportError:
sphinx_rtd_theme = None

project = 'KERIA'
copyright = '2023, Phil Feairheller'
author = 'Phil Feairheller'

version = release = keria.__version__

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = [
'myst_parser',
'sphinx.ext.viewcode',
'sphinx.ext.autosummary',
'sphinx.ext.autodoc',
'sphinx.ext.napoleon',
]

templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']



# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

if sphinx_rtd_theme:
html_theme = "sphinx_rtd_theme"
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
else:
html_theme = "default"

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
48 changes: 48 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
.. KERIA documentation master file, created by
sphinx-quickstart on Tue Aug 8 11:54:30 2023.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to KERIA's documentation!
=================================

.. image:: https://img.shields.io/pypi/v/keria.svg
:target: https://pypi.org/project/keria/
:alt: Latest Version

.. image:: https://github.com/WebOfTrust/keria/actions/workflows/python-app-ci.yml/badge.svg?branch=main
:target: https://github.com/WebOfTrust/keria/actions/workflows/python-app-ci.yml/badge.svg?branch=main

.. image:: https://codecov.io/gh/WebOfTrust/keria/branch/main/graph/badge.svg?token=D9XTQM401Z
:target: https://codecov.io/gh/WebOfTrust/keria

.. image:: https://img.shields.io/pypi/pyversions/keria.svg
:target: https://pypi.org/project/keria/

.. image:: https://readthedocs.org/projects/keria/badge/?version=latest
:target: https://keria.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status

.. toctree::
:maxdepth: 2
:caption: Contents:

README

API Reference
=============

.. toctree::
:maxdepth: 1

keria_app
keria_core
keria_db
keria_end

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
44 changes: 44 additions & 0 deletions docs/keria_app.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
KERIA App API
=============

keria.app.agenting
------------------

.. automodule:: keria.app.agenting
:members:

keria.app.aiding
----------------

.. automodule:: keria.app.aiding
:members:

keria.app.credentialing
-----------------------

.. automodule:: keria.app.credentialing
:members:

keria.app.indirecting
---------------------

.. automodule:: keria.app.indirecting
:members:

keria.app.notifying
-------------------

.. automodule:: keria.app.notifying
:members:

keria.app.presenting
--------------------

.. automodule:: keria.app.presenting
:members:

keria.app.specing
-----------------

.. automodule:: keria.app.specing
:members:
26 changes: 26 additions & 0 deletions docs/keria_core.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
KERIA Core API
==============

keria.core.authing
------------------

.. automodule:: keria.core.authing
:members:

keria.core.httping
------------------

.. automodule:: keria.core.httping
:members:

keria.core.keeping
------------------

.. automodule:: keria.core.keeping
:members:

keria.core.longrunning
----------------------

.. automodule:: keria.core.longrunning
:members:
8 changes: 8 additions & 0 deletions docs/keria_db.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
KERIA DB API
============

keria.db.basing
---------------

.. automodule:: keria.db.basing
:members:
8 changes: 8 additions & 0 deletions docs/keria_end.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
KERIA Endpoint API
==================

keria.end.ending
----------------

.. automodule:: keria.end.ending
:members:
35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.
set BUILDDIR=_build

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)

if "%1" == "" goto help

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
2 changes: 2 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
myst-parser >= 0.16.1
Sphinx >= 4.3.2
5 changes: 5 additions & 0 deletions src/keria/app/agenting.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@ def setup(name, bran, adminPort, bootPort, base='', httpPort=None, configFile=No


class Agency(doing.DoDoer):
"""
Agency
"""

def __init__(self, name, bran, base="", configFile=None, configDir=None, adb=None, temp=False):
self.name = name
self.base = base
Expand Down
2 changes: 1 addition & 1 deletion src/keria/app/aiding.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- encoding: utf-8 -*-
"""
KERIA
keria.app.ending module
keria.app.aiding module
"""
import json
Expand Down
2 changes: 1 addition & 1 deletion src/keria/app/credentialing.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- encoding: utf-8 -*-
"""
KERI
KERIA
keria.app.credentialing module
services and endpoint for ACDC credential managements
Expand Down
2 changes: 1 addition & 1 deletion src/keria/app/indirecting.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- encoding: utf-8 -*-
"""
KERI
KERIA
keria.app.indirecting module
simple indirect mode demo support classes
Expand Down
2 changes: 1 addition & 1 deletion src/keria/app/notifying.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- encoding: utf-8 -*-
"""
KERI
KERIA
keria.app.notifying module
"""
Expand Down
2 changes: 1 addition & 1 deletion src/keria/app/presenting.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- encoding: utf-8 -*-
"""
KERI
KERIA
keria.app.presenting module
services and endpoint for ACDC credential managements
Expand Down
5 changes: 5 additions & 0 deletions src/keria/app/specing.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@
import falcon
from apispec import yaml_utils
from apispec.core import VALID_METHODS, APISpec
"""
KERIA
keria.app.specing module
OpenAPI Description Resource for the KERI and ACDC ReST interface
"""

class AgentSpecResource:
"""
Expand Down
Loading

0 comments on commit 4224e1c

Please sign in to comment.