1818# documentation root, use os.path.abspath to make it absolute, like shown here.
1919#
2020# import os
21- import sys
22- # sys.path.insert(0, os.path.abspath('.'))
23-
24- # Mock C modules
25- try :
26- from unittest .Mock import MagicMock # Python >3.3
27- except ImportError :
28- try :
29- from mock import MagicMock
30- except ImportError :
31- raise ImportError ('No module named mock' )
32-
33- class Mock (MagicMock ):
34- @classmethod
35- def __getattr__ (cls , name ):
36- return MagicMock ()
21+ # import sys
3722
38- mock_modules = ['numpy' , 'samplerate._src' ]
39- sys .modules .update ((mod_name , Mock ()) for mod_name in mock_modules )
23+ # sys.path.insert(0, os.path.abspath('.'))
4024
4125import samplerate
4226
@@ -49,25 +33,24 @@ def __getattr__(cls, name):
4933# Add any Sphinx extension module names here, as strings. They can be
5034# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
5135# ones.
52- extensions = ['sphinx.ext.autodoc' , 'sphinx.ext.viewcode' ,
53- 'sphinx.ext.napoleon' ]
36+ extensions = ["sphinx.ext.autodoc" , "sphinx.ext.viewcode" , "sphinx.ext.napoleon" ]
5437
5538# Add any paths that contain templates here, relative to this directory.
56- templates_path = [' _templates' ]
39+ templates_path = [" _templates" ]
5740
5841# The suffix(es) of source filenames.
5942# You can specify multiple suffix as a list of string:
6043#
6144# source_suffix = ['.rst', '.md']
62- source_suffix = ' .rst'
45+ source_suffix = " .rst"
6346
6447# The master toctree document.
65- master_doc = ' index'
48+ master_doc = " index"
6649
6750# General information about the project.
68- project = ' python-samplerate'
69- copyright = ' 2017, Tino Wagner'
70- author = ' Tino Wagner'
51+ project = " python-samplerate"
52+ copyright = " 2017, Tino Wagner"
53+ author = " Tino Wagner"
7154
7255# The version info for the project you're documenting, acts as replacement for
7356# |version| and |release|, also used in various other places throughout the
@@ -77,28 +60,31 @@ def __getattr__(cls, name):
7760# The full version, including alpha/beta/rc tags.
7861release = samplerate .__version__
7962
63+
8064# The short X.Y version.
8165def get_short_version (version ):
8266 """Return short version from PEP-440 compatible version string."""
83- if '+' in version :
84- return version [:version .find ('+' )]
67+ if "+" in version :
68+ return version [: version .find ("+" )]
8569 return version
70+
71+
8672version = get_short_version (release )
8773
8874# The language for content autogenerated by Sphinx. Refer to documentation
8975# for a list of supported languages.
9076#
9177# This is also used if you do content translation via gettext catalogs.
9278# Usually you set "language" from the command line for these cases.
93- language = None
79+ language = "en"
9480
9581# List of patterns, relative to source directory, that match files and
9682# directories to ignore when looking for source files.
9783# This patterns also effect to html_static_path and html_extra_path
9884exclude_patterns = []
9985
10086# The name of the Pygments (syntax highlighting) style to use.
101- pygments_style = ' sphinx'
87+ pygments_style = " sphinx"
10288
10389# If true, `todo` and `todoList` produce output, else they produce nothing.
10490todo_include_todos = False
@@ -109,40 +95,40 @@ def get_short_version(version):
10995# The theme to use for HTML and HTML Help pages. See the documentation for
11096# a list of builtin themes.
11197#
112- html_theme = ' alabaster'
98+ html_theme = " alabaster"
11399
114100# Theme options are theme-specific and customize the look and feel of a theme
115101# further. For a list of options available for each theme, see the
116102# documentation.
117103#
118104html_theme_options = {
119- ' description' : ' Sample rate conversion in Python using libsamplerate' ,
120- ' github_user' : ' tuxu' ,
121- ' github_repo' : ' python-samplerate' ,
122- ' github_banner' : True ,
123- ' fixed_sidebar' : True ,
105+ " description" : " Sample rate conversion in Python using libsamplerate" ,
106+ " github_user" : " tuxu" ,
107+ " github_repo" : " python-samplerate" ,
108+ " github_banner" : True ,
109+ " fixed_sidebar" : True ,
124110}
125111
126112html_sidebars = {
127- '**' : [
128- ' about.html' ,
129- ' navigation.html' ,
130- ' relations.html' ,
131- ' searchbox.html' ,
132- ' donate.html' ,
113+ "**" : [
114+ " about.html" ,
115+ " navigation.html" ,
116+ " relations.html" ,
117+ " searchbox.html" ,
118+ " donate.html" ,
133119 ]
134120}
135121
136122# Add any paths that contain custom static files (such as style sheets) here,
137123# relative to this directory. They are copied after the builtin static files,
138124# so a file named "default.css" will overwrite the builtin "default.css".
139- html_static_path = [' _static' ]
125+ html_static_path = [" _static" ]
140126
141127
142128# -- Options for HTMLHelp output ------------------------------------------
143129
144130# Output file base name for HTML help builder.
145- htmlhelp_basename = ' python-sampleratedoc'
131+ htmlhelp_basename = " python-sampleratedoc"
146132
147133
148134# -- Options for LaTeX output ---------------------------------------------
@@ -151,15 +137,12 @@ def get_short_version(version):
151137 # The paper size ('letterpaper' or 'a4paper').
152138 #
153139 # 'papersize': 'letterpaper',
154-
155140 # The font size ('10pt', '11pt' or '12pt').
156141 #
157142 # 'pointsize': '10pt',
158-
159143 # Additional stuff for the LaTeX preamble.
160144 #
161145 # 'preamble': '',
162-
163146 # Latex figure (float) alignment
164147 #
165148 # 'figure_align': 'htbp',
@@ -169,8 +152,13 @@ def get_short_version(version):
169152# (source start file, target name, title,
170153# author, documentclass [howto, manual, or own class]).
171154latex_documents = [
172- (master_doc , 'python-samplerate.tex' , 'python-samplerate Documentation' ,
173- 'Tino Wagner' , 'manual' ),
155+ (
156+ master_doc ,
157+ "python-samplerate.tex" ,
158+ "python-samplerate Documentation" ,
159+ "Tino Wagner" ,
160+ "manual" ,
161+ ),
174162]
175163
176164
@@ -179,8 +167,7 @@ def get_short_version(version):
179167# One entry per manual page. List of tuples
180168# (source start file, name, description, authors, manual section).
181169man_pages = [
182- (master_doc , 'python-samplerate' , 'python-samplerate Documentation' ,
183- [author ], 1 )
170+ (master_doc , "python-samplerate" , "python-samplerate Documentation" , [author ], 1 )
184171]
185172
186173
@@ -190,7 +177,13 @@ def get_short_version(version):
190177# (source start file, target name, title, author,
191178# dir menu entry, description, category)
192179texinfo_documents = [
193- (master_doc , 'python-samplerate' , 'python-samplerate Documentation' ,
194- author , 'python-samplerate' , 'One line description of project.' ,
195- 'Miscellaneous' ),
180+ (
181+ master_doc ,
182+ "python-samplerate" ,
183+ "python-samplerate Documentation" ,
184+ author ,
185+ "python-samplerate" ,
186+ "One line description of project." ,
187+ "Miscellaneous" ,
188+ ),
196189]
0 commit comments