base64io-python/doc/conf.py

76 lines
2.1 KiB
Python
Raw Normal View History

2018-03-13 03:11:58 +00:00
# pylint: disable=invalid-name
"""Sphinx configuration."""
from datetime import datetime
import io
import os
import re
2018-06-05 23:21:48 +00:00
VERSION_RE = re.compile(r"""__version__ = ['"]([0-9.]+)['"]""")
2018-03-13 03:11:58 +00:00
HERE = os.path.abspath(os.path.dirname(__file__))
def read(*args):
"""Read complete file contents."""
2018-06-05 23:21:48 +00:00
return io.open(os.path.join(HERE, *args), encoding="utf-8").read()
2018-03-13 03:11:58 +00:00
def get_release():
"""Read the release (full three-part version number) from this module."""
2018-06-05 23:21:48 +00:00
init = read("..", "src", "base64io", "__init__.py")
2018-03-13 03:11:58 +00:00
return VERSION_RE.search(init).group(1)
def get_version():
"""Read the version (MAJOR.MINOR) from this module."""
_release = get_release()
2018-06-05 23:21:48 +00:00
split_version = _release.split(".")
2018-03-13 03:11:58 +00:00
if len(split_version) == 3:
2018-06-05 23:21:48 +00:00
return ".".join(split_version[:2])
2018-03-13 03:11:58 +00:00
return _release
2018-06-05 23:21:48 +00:00
project = u"base64io"
2018-03-13 03:11:58 +00:00
version = get_version()
release = get_release()
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
2018-06-05 23:21:48 +00:00
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.doctest",
"sphinx.ext.intersphinx",
"sphinx.ext.todo",
"sphinx.ext.coverage",
"sphinx.ext.autosummary",
"sphinx.ext.napoleon",
]
2018-03-13 03:11:58 +00:00
napoleon_include_special_with_doc = False
# Add any paths that contain templates here, relative to this directory.
2018-06-05 23:21:48 +00:00
templates_path = ["_templates"]
2018-03-13 03:11:58 +00:00
2018-06-05 23:21:48 +00:00
source_suffix = ".rst" # The suffix of source filenames.
master_doc = "index" # The master toctree document.
2018-03-13 03:11:58 +00:00
2018-06-05 23:21:48 +00:00
copyright = u"%s, Amazon" % datetime.now().year # pylint: disable=redefined-builtin
2018-03-13 03:11:58 +00:00
# List of directories, relative to source directory, that shouldn't be searched
# for source files.
2018-06-05 23:21:48 +00:00
exclude_trees = ["_build"]
2018-03-13 03:11:58 +00:00
2018-06-05 23:21:48 +00:00
pygments_style = "sphinx"
2018-03-13 03:11:58 +00:00
autoclass_content = "both"
2018-06-05 23:21:48 +00:00
autodoc_default_flags = ["show-inheritance", "members"]
autodoc_member_order = "bysource"
2018-03-13 03:11:58 +00:00
2018-06-05 23:21:48 +00:00
html_theme = "sphinx_rtd_theme"
html_static_path = ["_static"]
htmlhelp_basename = "%sdoc" % project
2018-03-13 03:11:58 +00:00
# Example configuration for intersphinx: refer to the Python standard library.
2018-06-05 23:21:48 +00:00
intersphinx_mapping = {"http://docs.python.org/": None}
2018-03-13 03:11:58 +00:00
# autosummary
autosummary_generate = True