Skip to content

Commit

Permalink
docs: add sphinx and readthedocs (#187)
Browse files Browse the repository at this point in the history
  • Loading branch information
JaeAeich authored May 30, 2024
1 parent c45c836 commit d1738c8
Show file tree
Hide file tree
Showing 11 changed files with 718 additions and 2 deletions.
17 changes: 17 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
version: 2

build:
os: ubuntu-22.04
tools:
python: '3.12'
jobs:
post_create_environment:
- pip install poetry
- poetry config virtualenvs.create false
post_install:
- poetry install --only docs

sphinx:
configuration: docs/source/conf.py
...
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[![codecov](https://codecov.io/gh/elixir-cloud-aai/TESK/branch/main/graph/badge.svg)](https://codecov.io/gh/elixir-cloud-aai/TESK)
[![Documentation Status](https://readthedocs.org/projects/tesk/badge/?version=latest)](https://tesk.readthedocs.io/en/latest/?badge=latest)
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](./LICENSE)
[![Python 3.11](https://img.shields.io/badge/python-3.11-blue.svg)](https://www.python.org/downloads/release/python-311/)
[![Development Status](https://img.shields.io/badge/status-beta-yellow.svg)](https://github.com/elixir-cloud-aai/TESK)
Expand All @@ -7,7 +8,7 @@
[![Safety](https://img.shields.io/badge/security-safety-orange.svg)](https://safetycli.com/product/safety-cli)
[![Ruff](https://img.shields.io/badge/code%20style-ruff-000000.svg)](https://docs.astral.sh/ruff/)

<img src="images/TESKlogowfont.png" height="200">
<img src="/images/TESKlogowfont.png" height="200">

An implementation of a task execution engine based on the
[TES standard](https://github.com/ga4gh/task-execution-schemas) running on
Expand Down
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 = source
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)
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=source
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
100 changes: 100 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
"""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 datetime
import os
import sys
from pathlib import Path

import tomli

sys.path.insert(0, os.path.abspath('../..'))


# -- Project information -----------------------------------------------------
def _get_project_meta():
_pyproject_path = Path(__file__).parents[2] / 'pyproject.toml'
with open(_pyproject_path, mode='rb') as pyproject:
return tomli.load(pyproject)['tool']['poetry']


pkg_meta = _get_project_meta()
current_year = datetime.datetime.now().year
project = str(pkg_meta['name'])
project_copyright = f"{current_year}, {str(pkg_meta['authors'][0])}"
author = str(pkg_meta['authors'][0])

version = str(pkg_meta['version'])
release = version

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

extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.todo',
'sphinx.ext.coverage',
'sphinx.ext.viewcode',
'sphinx.ext.autosummary',
# Used to write beautiful docstrings:
'sphinx.ext.napoleon',
# Used to include .md files:
'm2r2',
# Used to insert typehints into the final docs:
'sphinx_autodoc_typehints',
# Used to embed values from the source code into the docs:
'added_value',
]

# Set `typing.TYPE_CHECKING` to `True`:
# https://pypi.org/project/sphinx-autodoc-typehints/
set_type_checking_flag = False
always_document_param_types = False

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:

source_suffix = ['.rst', '.md']

# The master toctree document.
master_doc = 'index'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = 'en'

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path .
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

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'furo'

# 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']

# -- Extension configuration -------------------------------------------------
napoleon_numpy_docstring = False

# -- Options for todo extension ----------------------------------------------

# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = True
31 changes: 31 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
TESK
=================================

.. toctree::
:maxdepth: 1
:caption: TESK

.. mdinclude:: ../../README.md
.. mdinclude:: ../tesintro.md

.. Not adding a heading to separate deployment docs because
.. these md files already have heading.
.. mdinclude:: ../../deployment/documentation/deployment.md
.. mdinclude:: ../../deployment/documentation/integrated_wes_tes.md
.. mdinclude:: ../../deployment/documentation/local_ftp.md

Package contents
==================

.. toctree::
:maxdepth: 2
:caption: package

pages/tesk/modules

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

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
7 changes: 7 additions & 0 deletions docs/source/pages/tesk/modules.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
tesk
====

.. toctree::
:maxdepth: 4

tesk
18 changes: 18 additions & 0 deletions docs/source/pages/tesk/tesk.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
tesk package
============

Subpackages
-----------

.. toctree::
:maxdepth: 4

tesk.services

Module contents
---------------

.. automodule:: tesk
:members:
:undoc-members:
:show-inheritance:
101 changes: 101 additions & 0 deletions docs/source/pages/tesk/tesk.services.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
tesk.services package
=====================

Submodules
----------

tesk.services.constants module
------------------------------

.. automodule:: tesk.services.constants
:members:
:undoc-members:
:show-inheritance:

tesk.services.exceptions module
-------------------------------

.. automodule:: tesk.services.exceptions
:members:
:undoc-members:
:show-inheritance:

tesk.services.filer module
--------------------------

.. automodule:: tesk.services.filer
:members:
:undoc-members:
:show-inheritance:

tesk.services.filer\_class module
---------------------------------

.. automodule:: tesk.services.filer_class
:members:
:undoc-members:
:show-inheritance:

tesk.services.filer\_s3 module
------------------------------

.. automodule:: tesk.services.filer_s3
:members:
:undoc-members:
:show-inheritance:

tesk.services.job module
------------------------

.. automodule:: tesk.services.job
:members:
:undoc-members:
:show-inheritance:

tesk.services.path module
-------------------------

.. automodule:: tesk.services.path
:members:
:undoc-members:
:show-inheritance:

tesk.services.pvc module
------------------------

.. automodule:: tesk.services.pvc
:members:
:undoc-members:
:show-inheritance:

tesk.services.taskmaster module
-------------------------------

.. automodule:: tesk.services.taskmaster
:members:
:undoc-members:
:show-inheritance:

tesk.services.transput module
-----------------------------

.. automodule:: tesk.services.transput
:members:
:undoc-members:
:show-inheritance:

tesk.services.utils module
--------------------------

.. automodule:: tesk.services.utils
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

.. automodule:: tesk.services
:members:
:undoc-members:
:show-inheritance:
Loading

0 comments on commit d1738c8

Please sign in to comment.