From 61684f9a4691449dc8aa129976789e3feab2b713 Mon Sep 17 00:00:00 2001 From: Benjamin Klimczak Date: Mon, 8 Aug 2022 16:29:21 +0100 Subject: MLIA-571 Use tox to run additional project tasks - Remove coverage from the pre-commit hooks as it takes too long and is not really suited to be a pre-commit hook - Added tox environments: - 'coverage': Run the code coverage. The code coverage was moved from the pre-commit hooks to tox. - 'lint': Run the pre-commit hooks - 'build': Build a distribution of MLIA - 'docs': Create documentation from the source code. Directory docs/ was added and copyright and license information add to files. Change-Id: Ife92b68043295ce41a0f2352ee2b2878329f4953 --- docs/Makefile | 22 ++++++++++++++++ docs/source/_static/.gitignore | 3 +++ docs/source/_templates/.gitignore | 3 +++ docs/source/conf.py | 54 +++++++++++++++++++++++++++++++++++++++ docs/source/index.rst | 23 +++++++++++++++++ 5 files changed, 105 insertions(+) create mode 100644 docs/Makefile create mode 100644 docs/source/_static/.gitignore create mode 100644 docs/source/_templates/.gitignore create mode 100644 docs/source/conf.py create mode 100644 docs/source/index.rst (limited to 'docs') diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..3cd6a93 --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,22 @@ +# SPDX-FileCopyrightText: Copyright 2022, Arm Limited and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + +# 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) diff --git a/docs/source/_static/.gitignore b/docs/source/_static/.gitignore new file mode 100644 index 0000000..dce3494 --- /dev/null +++ b/docs/source/_static/.gitignore @@ -0,0 +1,3 @@ +# SPDX-FileCopyrightText: Copyright 2022, Arm Limited and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 +# Placeholder diff --git a/docs/source/_templates/.gitignore b/docs/source/_templates/.gitignore new file mode 100644 index 0000000..dce3494 --- /dev/null +++ b/docs/source/_templates/.gitignore @@ -0,0 +1,3 @@ +# SPDX-FileCopyrightText: Copyright 2022, Arm Limited and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 +# Placeholder diff --git a/docs/source/conf.py b/docs/source/conf.py new file mode 100644 index 0000000..1073089 --- /dev/null +++ b/docs/source/conf.py @@ -0,0 +1,54 @@ +# SPDX-FileCopyrightText: Copyright 2022, Arm Limited and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 +"""Configuration file for the Sphinx documentation builder.""" +# This file only contains a selection of the most common options. For a full +# list see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html +# -- Path setup -------------------------------------------------------------- +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +# +# import os +# import sys +# sys.path.insert(0, os.path.abspath('.')) +import mlia + +# -- Project information ----------------------------------------------------- +"""The configuration file for sphinx.""" +# pylint: skip-file +project = "mlia" +copyright = "Copyright (C) 2021-2022, Arm Ltd." +author = "Arm Ltd (mlia@arm.com)" + +# The full version, including alpha/beta/rc tags +release = mlia.__version__ + + +# -- General configuration --------------------------------------------------- + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = ["sphinx.ext.autodoc"] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ["_templates"] + +# 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 = [] # type: ignore + + +# -- 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 = "sphinx_rtd_theme" + +# 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"] diff --git a/docs/source/index.rst b/docs/source/index.rst new file mode 100644 index 0000000..1b852b8 --- /dev/null +++ b/docs/source/index.rst @@ -0,0 +1,23 @@ +.. # SPDX-FileCopyrightText: Copyright 2022, Arm Limited and/or its affiliates. +.. # SPDX-License-Identifier: Apache-2.0 + +.. mlia documentation main file, created by + sphinx-quickstart on Thu Sep 30 13:32:29 2021. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to mlia's documentation! +================================ + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` -- cgit v1.2.1