• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# -*- coding: utf-8 -*-
2#
3# oauth2client documentation build configuration file, created by
4# sphinx-quickstart on Wed Dec 17 23:13:19 2014.
5#
6
7import os
8import sys
9
10
11# In order to load django before 1.7, we need to create a faux
12# settings module and load it. This assumes django has been installed
13# (but it must be for the docs to build), so if it has not already
14# been installed run `pip install -r docs/requirements.txt`.
15os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.contrib.django_util.settings'
16import django
17import mock
18from pkg_resources import get_distribution
19if django.VERSION[1] < 7:
20    sys.path.insert(0, '.')
21
22# See https://read-the-docs.readthedocs.io/en/latest/faq.html#i-get-import-errors-on-libraries-that-depend-on-c-modules
23
24
25class Mock(mock.Mock):
26
27    @classmethod
28    def __getattr__(cls, name):
29            return Mock()
30
31
32MOCK_MODULES = (
33    'google',
34    'google.appengine',
35    'google.appengine.api',
36    'google.appengine.api.app_identiy',
37    'google.appengine.api.urlfetch',
38    'google.appengine.ext',
39    'google.appengine.ext.webapp',
40    'google.appengine.ext.webapp.util',
41    'werkzeug.local',
42)
43
44
45# If extensions (or modules to document with autodoc) are in another directory,
46# add these directories to sys.path here. If the directory is relative to the
47# documentation root, use os.path.abspath to make it absolute, like shown here.
48sys.path.insert(0, os.path.abspath('..'))
49
50# -- General configuration ------------------------------------------------
51
52extensions = [
53    'sphinx.ext.autodoc',
54    'sphinx.ext.coverage',
55    'sphinx.ext.napoleon',
56    'sphinx.ext.viewcode',
57]
58templates_path = ['_templates']
59source_suffix = '.rst'
60master_doc = 'index'
61
62# General information about the project.
63project = u'oauth2client'
64copyright = u'2014, Google, Inc'
65
66# Version info
67distro = get_distribution('oauth2client')
68version = distro.version
69release = distro.version
70
71exclude_patterns = ['_build']
72
73# -- Options for HTML output ----------------------------------------------
74
75# We fake our more expensive imports when building the docs.
76sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)
77
78# We want to set the RTD theme, but not if we're on RTD.
79if os.environ.get('READTHEDOCS', None) != 'True':
80    import sphinx_rtd_theme
81    html_theme = 'sphinx_rtd_theme'
82    html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
83
84# The name of an image file (within the static path) to use as favicon of the
85# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
86# pixels large.
87html_favicon = '_static/favicon.ico'
88
89html_static_path = ['_static']
90html_logo = '_static/google_logo.png'
91htmlhelp_basename = 'oauth2clientdoc'
92
93# -- Options for LaTeX output ---------------------------------------------
94
95latex_elements = {}
96latex_documents = [
97    ('index', 'oauth2client.tex', u'oauth2client Documentation',
98     u'Google, Inc.', 'manual'),
99]
100
101# -- Options for manual page output ---------------------------------------
102
103man_pages = [
104    ('index', 'oauth2client', u'oauth2client Documentation',
105     [u'Google, Inc.'], 1)
106]
107
108# -- Options for Texinfo output -------------------------------------------
109
110texinfo_documents = [
111    ('index', 'oauth2client', u'oauth2client Documentation',
112     u'Google, Inc.', 'oauth2client', 'One line description of project.',
113     'Miscellaneous'),
114]
115