Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import copy
import os
from pathlib import Path
from m2r import MdInclude
Expand Down Expand Up @@ -50,6 +51,23 @@

autodoc_typehints = 'description'

# mock missing site packages methods
import site
mock_site_methods = {
# Format:
# method name: return value
'getusersitepackages': '',
'getsitepackages': []
}
__fn = None
for __name, __rval in mock_site_methods.items():
if not hasattr(site, __name):
__fn = lambda *args, __rval=copy.deepcopy(__rval), **kwargs: __rval
setattr(site, __name, __fn)
del __name
del __rval
del __fn

# Prefix each autosectionlabel with the name of the document it is in and a colon
autosectionlabel_prefix_document = True

Expand Down