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