|
1 | 1 | # pylint: disable=invalid-name
|
2 | 2 | """Sphinx configuration."""
|
3 |
| -from datetime import datetime |
4 | 3 | import io
|
5 | 4 | import os
|
6 | 5 | import re
|
| 6 | +from datetime import datetime |
7 | 7 |
|
8 |
| -VERSION_RE = re.compile(r'''__version__ = ['"]([0-9.]+)['"]''') |
| 8 | +VERSION_RE = re.compile(r"""__version__ = ['"]([0-9.]+)['"]""") |
9 | 9 | HERE = os.path.abspath(os.path.dirname(__file__))
|
10 | 10 |
|
11 | 11 |
|
12 | 12 | def read(*args):
|
13 | 13 | """Reads complete file contents."""
|
14 |
| - return io.open(os.path.join(HERE, *args), encoding='utf-8').read() |
| 14 | + return io.open(os.path.join(HERE, *args), encoding="utf-8").read() |
15 | 15 |
|
16 | 16 |
|
17 | 17 | def get_release():
|
18 | 18 | """Reads the release (full three-part version number) from this module."""
|
19 |
| - init = read('..', 'src', 'dynamodb_encryption_sdk', 'identifiers.py') |
| 19 | + init = read("..", "src", "dynamodb_encryption_sdk", "identifiers.py") |
20 | 20 | return VERSION_RE.search(init).group(1)
|
21 | 21 |
|
22 | 22 |
|
23 | 23 | def get_version():
|
24 | 24 | """Reads the version (MAJOR.MINOR) from this module."""
|
25 | 25 | _release = get_release()
|
26 |
| - split_version = _release.split('.') |
| 26 | + split_version = _release.split(".") |
27 | 27 | if len(split_version) == 3:
|
28 |
| - return '.'.join(split_version[:2]) |
| 28 | + return ".".join(split_version[:2]) |
29 | 29 | return _release
|
30 | 30 |
|
31 | 31 |
|
32 |
| -project = u'dynamodb-encryption-sdk-python' |
| 32 | +project = u"dynamodb-encryption-sdk-python" |
33 | 33 | version = get_version()
|
34 | 34 | release = get_release()
|
35 | 35 |
|
36 | 36 | # Add any Sphinx extension module names here, as strings. They can be extensions
|
37 | 37 | # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
|
38 |
| -extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', |
39 |
| - 'sphinx.ext.intersphinx', 'sphinx.ext.todo', |
40 |
| - 'sphinx.ext.coverage', 'sphinx.ext.autosummary', |
41 |
| - 'sphinx.ext.napoleon', 'sphinx.ext.viewcode'] |
| 38 | +extensions = [ |
| 39 | + "sphinx.ext.autodoc", |
| 40 | + "sphinx.ext.doctest", |
| 41 | + "sphinx.ext.intersphinx", |
| 42 | + "sphinx.ext.todo", |
| 43 | + "sphinx.ext.coverage", |
| 44 | + "sphinx.ext.autosummary", |
| 45 | + "sphinx.ext.napoleon", |
| 46 | + "sphinx.ext.viewcode", |
| 47 | +] |
42 | 48 | napoleon_include_special_with_doc = False
|
43 | 49 |
|
44 | 50 | # Add any paths that contain templates here, relative to this directory.
|
45 |
| -templates_path = ['_templates'] |
| 51 | +templates_path = ["_templates"] |
46 | 52 |
|
47 |
| -source_suffix = '.rst' # The suffix of source filenames. |
48 |
| -master_doc = 'index' # The master toctree document. |
| 53 | +source_suffix = ".rst" # The suffix of source filenames. |
| 54 | +master_doc = "index" # The master toctree document. |
49 | 55 |
|
50 |
| -copyright = u'%s, Amazon' % datetime.now().year # pylint: disable=redefined-builtin |
| 56 | +copyright = u"%s, Amazon" % datetime.now().year # pylint: disable=redefined-builtin |
51 | 57 |
|
52 | 58 | # List of directories, relative to source directory, that shouldn't be searched
|
53 | 59 | # for source files.
|
54 |
| -exclude_trees = ['_build'] |
| 60 | +exclude_trees = ["_build"] |
55 | 61 |
|
56 |
| -pygments_style = 'sphinx' |
| 62 | +pygments_style = "sphinx" |
57 | 63 |
|
58 | 64 | autoclass_content = "both"
|
59 |
| -autodoc_default_flags = ['show-inheritance', 'members'] |
60 |
| -autodoc_member_order = 'bysource' |
| 65 | +autodoc_default_flags = ["show-inheritance", "members"] |
| 66 | +autodoc_member_order = "bysource" |
61 | 67 |
|
62 |
| -html_theme = 'sphinx_rtd_theme' |
63 |
| -html_static_path = ['_static'] |
64 |
| -htmlhelp_basename = '%sdoc' % project |
| 68 | +html_theme = "sphinx_rtd_theme" |
| 69 | +html_static_path = ["_static"] |
| 70 | +htmlhelp_basename = "%sdoc" % project |
65 | 71 |
|
66 | 72 | # Example configuration for intersphinx: refer to the Python standard library.
|
67 |
| -intersphinx_mapping = {'python': ('http://docs.python.org/', None)} |
| 73 | +intersphinx_mapping = {"python": ("http://docs.python.org/", None)} |
68 | 74 |
|
69 | 75 | # autosummary
|
70 | 76 | autosummary_generate = True
|
0 commit comments