|
18 | 18 | # |
19 | 19 | import os |
20 | 20 | import sys |
| 21 | +import inspect |
21 | 22 |
|
22 | 23 | sys.path.insert(0, os.path.abspath('..')) |
23 | 24 |
|
| 25 | +currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) |
| 26 | +parentdir = os.path.dirname(currentdir) |
| 27 | +sys.path.insert(0, parentdir) |
| 28 | + |
| 29 | +# Importar el módulo principal - ¡ESTO ES CLAVE! |
| 30 | +import ad_api |
24 | 31 |
|
25 | 32 | # -- General configuration ------------------------------------------------ |
26 | 33 |
|
|
31 | 38 | # Add any Sphinx extension module names here, as strings. They can be |
32 | 39 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom |
33 | 40 | # ones. |
34 | | -extensions = ['sphinx.ext.autodoc', 'sphinx_rtd_theme'] |
35 | | - |
36 | | -# Mockear importaciones problemáticas para que autodoc funcione |
37 | | -autodoc_mock_imports = [ |
38 | | - "requests", |
39 | | - "cachetools", |
40 | | - "pycryptodome", |
41 | | - "pytz", |
42 | | - "confuse", |
43 | | - "six", |
44 | | - "python-dotenv", |
45 | | - "pyyaml", |
46 | | - # El paquete principal se mockea como respaldo |
47 | | - "ad_api", |
| 41 | +extensions = [ |
| 42 | + 'sphinx.ext.autodoc', |
| 43 | + 'sphinx.ext.napoleon', # ¡IMPORTANTE para docstrings estilo Google! |
| 44 | + 'sphinx_rtd_theme' |
48 | 45 | ] |
49 | 46 |
|
| 47 | +# Configuración de autodoc (como en el repo que funciona) |
| 48 | +autodoc_default_options = { |
| 49 | + "members": True, |
| 50 | + "undoc-members": True, |
| 51 | + "member-order": "bysource" |
| 52 | +} |
| 53 | + |
| 54 | +# Configuración de napoleon para docstrings estilo Google |
| 55 | +napoleon_google_docstring = True |
| 56 | +napoleon_numpy_docstring = False |
| 57 | +napoleon_include_init_with_doc = True |
| 58 | +napoleon_include_private_with_doc = False |
| 59 | +napoleon_include_special_with_doc = True |
50 | 60 |
|
51 | 61 | # Add any paths that contain templates here, relative to this directory. |
52 | 62 | templates_path = ['_templates'] |
|
68 | 78 |
|
69 | 79 | # General information about the project. |
70 | 80 | project = u'Python Amazon Advertising API' |
71 | | -copyright = u'2022, DAC' |
72 | | -author = u'DAC' |
| 81 | +copyright = u'2023, Daniel Alvaro' |
| 82 | +author = u'Daniel Alvaro' |
73 | 83 |
|
74 | 84 | # The version info for the project you're documenting, acts as replacement for |
75 | 85 | # |version| and |release|, also used in various other places throughout the |
76 | 86 | # built documents. |
77 | 87 | # |
78 | 88 | # The short X.Y version. |
79 | | -version = u'0.4.3' |
| 89 | +version = u'0.7.4' |
80 | 90 | # The full version, including alpha/beta/rc tags. |
81 | | -release = u'0.4.3' |
| 91 | +release = u'0.7.4' |
82 | 92 |
|
83 | 93 | # The language for content autogenerated by Sphinx. Refer to documentation |
84 | 94 | # for a list of supported languages. |
|
99 | 109 | # List of patterns, relative to source directory, that match files and |
100 | 110 | # directories to ignore when looking for source files. |
101 | 111 | # This patterns also effect to html_static_path and html_extra_path |
102 | | -exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', 'ad_api/base/*.py'] |
| 112 | +exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] |
103 | 113 |
|
104 | 114 | # The reST default role (used for this markup: `text`) to use for all |
105 | 115 | # documents. |
106 | 116 | # |
107 | 117 | # default_role = None |
108 | 118 |
|
109 | | -# If true, '()' will be appended to :func: etc. cross-reference text. |
| 119 | +# If true, '()' will be appended to :param: and :param type: in function |
| 120 | +# descriptions. |
110 | 121 | # |
111 | | -# add_function_parentheses = True |
| 122 | +add_function_parentheses = True |
112 | 123 |
|
113 | 124 | # If true, the current module name will be prepended to all description |
114 | 125 | # unit titles (such as .. function::). |
115 | 126 | # |
116 | | -# add_module_names = True |
| 127 | +add_module_names = True |
117 | 128 |
|
118 | 129 | # If true, sectionauthor and moduleauthor directives will be shown in the |
119 | 130 | # output. They are ignored by default. |
|
133 | 144 | todo_include_todos = False |
134 | 145 |
|
135 | 146 |
|
136 | | - |
137 | | -# -- Configuración adicional para autodoc -- |
138 | | - |
139 | | -# Configuración adicional para autodoc con decoradores |
140 | | -autodoc_default_options = { |
141 | | - "members": True, |
142 | | - "member-order": "bysource", |
143 | | - "special-members": "__init__", |
144 | | - "undoc-members": True, |
145 | | - "exclude-members": "__weakref__" |
146 | | -} |
147 | | - |
148 | | -# Importante para métodos decorados |
149 | | -autodoc_inherit_docstrings = True |
150 | | - |
151 | | -# Para preservar signatures con decoradores |
152 | | -autodoc_preserve_defaults = True |
153 | | - |
154 | | -# Configurar cómo se muestran los type hints |
155 | | -autodoc_typehints = "signature" |
156 | | -autodoc_typehints_format = "short" |
157 | | - |
158 | 147 | # -- Options for HTML output ---------------------------------------------- |
159 | 148 |
|
160 | 149 | # The theme to use for HTML and HTML Help pages. See the documentation for |
161 | 150 | # a list of builtin themes. |
162 | 151 | # |
163 | | -# html_theme = 'haiku' |
164 | 152 | html_theme = 'sphinx_rtd_theme' |
165 | 153 |
|
166 | 154 | # Theme options are theme-specific and customize the look and feel of a theme |
|
172 | 160 | # Add any paths that contain custom themes here, relative to this directory. |
173 | 161 | # html_theme_path = [] |
174 | 162 |
|
175 | | -# The name for this set of Sphinx documents. |
176 | | -# "<project> v<release> documentation" by default. |
177 | | -# |
178 | | -# html_title = u'autodoc-example v0.1' |
| 163 | +# The name for this set of Sphinx documents. If None, it defaults to |
| 164 | +# "<project> v<release> documentation". |
| 165 | +html_title = u'Python Amazon Advertising API v0.7.4' |
179 | 166 |
|
180 | 167 | # A shorter title for the navigation bar. Default is the same as html_title. |
181 | | -# |
182 | 168 | # html_short_title = None |
183 | 169 |
|
184 | 170 | # The name of an image file (relative to this directory) to place at the top |
185 | 171 | # of the sidebar. |
186 | | -# |
187 | 172 | # html_logo = None |
188 | 173 |
|
189 | 174 | # The name of an image file (relative to this directory) to use as a favicon of |
190 | | -# the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 |
| 175 | +# the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 |
191 | 176 | # pixels large. |
192 | | -# |
193 | 177 | # html_favicon = None |
194 | 178 |
|
195 | 179 | # Add any paths that contain custom static files (such as style sheets) here, |
|
200 | 184 | # Add any extra paths that contain custom files (such as robots.txt or |
201 | 185 | # .htaccess) here, relative to this directory. These files are copied |
202 | 186 | # directly to the root of the documentation. |
203 | | -# |
204 | 187 | # html_extra_path = [] |
205 | 188 |
|
206 | 189 | # If not None, a 'Last updated on:' timestamp is inserted at every page |
207 | 190 | # bottom, using the given strftime format. |
208 | | -# The empty string is equivalent to '%b %d, %Y'. |
209 | | -# |
210 | 191 | # html_last_updated_fmt = None |
211 | 192 |
|
212 | 193 | # If true, SmartyPants will be used to convert quotes and dashes to |
213 | 194 | # typographically correct entities. |
214 | | -# |
215 | 195 | # html_use_smartypants = True |
216 | 196 |
|
217 | 197 | # Custom sidebar templates, maps document names to template names. |
218 | | -# |
219 | 198 | # html_sidebars = {} |
220 | 199 |
|
221 | 200 | # Additional templates that should be rendered to pages, maps page names to |
222 | 201 | # template names. |
223 | | -# |
224 | 202 | # html_additional_pages = {} |
225 | 203 |
|
226 | 204 | # If false, no module index is generated. |
227 | | -# |
228 | 205 | # html_domain_indices = True |
229 | 206 |
|
230 | 207 | # If false, no index is generated. |
231 | | -# |
232 | 208 | # html_use_index = True |
233 | 209 |
|
234 | 210 | # If true, the index is split into individual pages for each letter. |
235 | | -# |
236 | 211 | # html_split_index = False |
237 | 212 |
|
238 | 213 | # If true, links to the reST sources are added to the pages. |
239 | | -# |
240 | 214 | # html_show_sourcelink = True |
241 | 215 |
|
242 | 216 | # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. |
243 | | -# |
244 | 217 | # html_show_sphinx = True |
245 | 218 |
|
246 | 219 | # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. |
247 | | -# |
248 | 220 | # html_show_copyright = True |
249 | 221 |
|
250 | 222 | # If true, an OpenSearch description file will be output, and all pages will |
251 | 223 | # contain a <link> tag referring to it. The value of this option must be the |
252 | | -# base URL from which the finished HTML is served. |
253 | | -# |
| 224 | +# base URL from which the finished documentation is served. |
254 | 225 | # html_use_opensearch = '' |
255 | 226 |
|
256 | 227 | # This is the file name suffix for HTML files (e.g. ".xhtml"). |
|
260 | 231 | # Sphinx supports the following languages: |
261 | 232 | # 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' |
262 | 233 | # 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr', 'zh' |
263 | | -# |
264 | 234 | # html_search_language = 'en' |
265 | 235 |
|
266 | 236 | # A dictionary with options for the search language support, empty by default. |
267 | | -# 'ja' uses this config value. |
268 | | -# 'zh' user can custom change `jieba` dictionary path. |
269 | | -# |
270 | 237 | # html_search_options = {'type': 'default'} |
271 | 238 |
|
272 | 239 | # The name of a javascript file (relative to the configuration directory) that |
273 | 240 | # implements a search results scorer. If empty, the default will be used. |
274 | | -# |
275 | 241 | # html_search_scorer = 'scorer.js' |
276 | 242 |
|
277 | 243 | # Output file base name for HTML help builder. |
278 | | -htmlhelp_basename = 'autodoc-exampledoc' |
| 244 | +htmlhelp_basename = 'python-amazon-ad-apidoc' |
279 | 245 |
|
280 | 246 | # -- Options for LaTeX output --------------------------------------------- |
281 | 247 |
|
282 | 248 | latex_elements = { |
283 | 249 | # The paper size ('letterpaper' or 'a4paper'). |
284 | 250 | # |
285 | 251 | # 'papersize': 'letterpaper', |
| 252 | + |
286 | 253 | # The font size ('10pt', '11pt' or '12pt'). |
287 | 254 | # |
288 | 255 | # 'pointsize': '10pt', |
| 256 | + |
289 | 257 | # Additional stuff for the LaTeX preamble. |
290 | 258 | # |
291 | 259 | # 'preamble': '', |
| 260 | + |
292 | 261 | # Latex figure (float) alignment |
293 | 262 | # |
294 | 263 | # 'figure_align': 'htbp', |
|
298 | 267 | # (source start file, target name, title, |
299 | 268 | # author, documentclass [howto, manual, or own class]). |
300 | 269 | latex_documents = [ |
301 | | - (master_doc, 'autodoc-example.tex', u'autodoc-example Documentation', u'Eric Beahan', 'manual'), |
| 270 | + (master_doc, 'python-amazon-ad-api.tex', u'Python Amazon Advertising API Documentation', |
| 271 | + u'Daniel Alvaro', 'manual'), |
302 | 272 | ] |
303 | 273 |
|
304 | 274 | # The name of an image file (relative to this directory) to place at the top of |
305 | 275 | # the title page. |
306 | | -# |
307 | 276 | # latex_logo = None |
308 | 277 |
|
309 | 278 | # For "manual" documents, if this is true, then toplevel headings are parts, |
310 | 279 | # not chapters. |
311 | | -# |
312 | 280 | # latex_use_parts = False |
313 | 281 |
|
314 | 282 | # If true, show page references after internal links. |
315 | | -# |
316 | 283 | # latex_show_pagerefs = False |
317 | 284 |
|
318 | 285 | # If true, show URL addresses after external links. |
319 | | -# |
320 | 286 | # latex_show_urls = False |
321 | 287 |
|
322 | 288 | # Documents to append as an appendix to all manuals. |
323 | | -# |
324 | 289 | # latex_appendices = [] |
325 | 290 |
|
326 | | -# It false, will not define \strong, \code, \titleref, \crossref ... but only |
327 | | -# \sphinxstrong, ..., \sphinxtitleref, ... To help avoid clash with user added |
328 | | -# packages. |
329 | | -# |
330 | | -# latex_keep_old_macro_names = True |
331 | | - |
332 | 291 | # If false, no module index is generated. |
333 | | -# |
334 | 292 | # latex_domain_indices = True |
335 | 293 |
|
336 | 294 |
|
337 | 295 | # -- Options for manual page output --------------------------------------- |
338 | 296 |
|
339 | | -html_style = 'css/custom.css' |
340 | | - |
341 | 297 | # One entry per manual page. List of tuples |
342 | 298 | # (source start file, name, description, authors, manual section). |
343 | | -man_pages = [(master_doc, 'autodoc-example', u'autodoc-example Documentation', [author], 1)] |
| 299 | +man_pages = [ |
| 300 | + (master_doc, 'python-amazon-ad-api', u'Python Amazon Advertising API Documentation', |
| 301 | + [author], 1) |
| 302 | +] |
344 | 303 |
|
345 | 304 | # If true, show URL addresses after external links. |
346 | | -# |
347 | 305 | # man_show_urls = False |
348 | 306 |
|
349 | 307 |
|
|
353 | 311 | # (source start file, target name, title, author, |
354 | 312 | # dir menu entry, description, category) |
355 | 313 | texinfo_documents = [ |
356 | | - ( |
357 | | - master_doc, |
358 | | - 'autodoc-example', |
359 | | - u'autodoc-example Documentation', |
360 | | - author, |
361 | | - 'autodoc-example', |
362 | | - 'One line description of project.', |
363 | | - 'Miscellaneous', |
364 | | - ), |
| 314 | + (master_doc, 'python-amazon-ad-api', u'Python Amazon Advertising API Documentation', |
| 315 | + author, 'python-amazon-ad-api', 'Python wrapper for the Amazon Advertising API.', |
| 316 | + 'Miscellaneous'), |
365 | 317 | ] |
366 | 318 |
|
367 | 319 | # Documents to append as an appendix to all manuals. |
368 | | -# |
369 | 320 | # texinfo_appendices = [] |
370 | 321 |
|
371 | 322 | # If false, no module index is generated. |
372 | | -# |
373 | 323 | # texinfo_domain_indices = True |
374 | 324 |
|
375 | 325 | # How to display URL addresses: 'footnote', 'no', or 'inline'. |
376 | | -# |
377 | 326 | # texinfo_show_urls = 'footnote' |
378 | 327 |
|
379 | 328 | # If true, do not generate a @detailmenu in the "Top" node's menu. |
380 | | -# |
381 | 329 | # texinfo_no_detailmenu = False |
0 commit comments