diff options
author | Sviatoslav Sydorenko <wk@sydorenko.org.ua> | 2023-01-03 01:54:00 +0100 |
---|---|---|
committer | Sviatoslav Sydorenko <wk@sydorenko.org.ua> | 2023-01-03 01:54:00 +0100 |
commit | 45b60a251e226d3f81fc15ddc591fec28de8ac59 (patch) | |
tree | 799cd1c17c08de1c495d8e72c66e6ad23234adc8 | |
parent | 94711f4ab36d016a8b5a6a535528986b2d5d0025 (diff) | |
download | cherrypy-git-45b60a251e226d3f81fc15ddc591fec28de8ac59.tar.gz |
Subst mock_pywin32 w/ Sphinx autodoc_mock_imports
-rw-r--r-- | docs/conf.py | 35 |
1 files changed, 11 insertions, 24 deletions
diff --git a/docs/conf.py b/docs/conf.py index 0ff41fa6..a45e632d 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -200,30 +200,6 @@ latex_documents = [ ] -def mock_pywin32(): - """Mock pywin32 module. - - Resulting in Linux hosts, including ReadTheDocs, - and other environments that don't have pywin32 can generate the docs - properly including the PDF version. - See: - http://read-the-docs.readthedocs.org/en/latest/faq.html#i-get-import-errors-on-libraries-that-depend-on-c-modules - """ - if try_import('win32api'): - return - - from unittest import mock - - MOCK_MODULES = [ - 'win32api', 'win32con', 'win32event', 'win32service', - 'win32serviceutil', - ] - for mod_name in MOCK_MODULES: - sys.modules[mod_name] = mock.MagicMock() - - -mock_pywin32() - link_files = { '../CHANGES.rst': dict( using=dict( @@ -244,6 +220,17 @@ link_files = { default_role = 'any' +# -- Options for autodoc extension --------------------------------------- + +autodoc_mock_imports = [ + 'win32api', + 'win32con', + 'win32event', + 'win32service', + 'win32serviceutil', +] + + # -- Options for apidoc extension ---------------------------------------- apidoc_excluded_paths = [] |