forked from BoboTiG/python-mss
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconf.py
More file actions
90 lines (71 loc) · 2.57 KB
/
conf.py
File metadata and controls
90 lines (71 loc) · 2.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# Lets prevent misses, and import the module to get the proper version.
# So that the version in only defined once across the whole code base:
# src/mss/__init__.py
import sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).parent.parent.parent / "src"))
import ctypes
# Monkey-patch PROT_READ into mmap if missing (Windows), so that we can
# import mss.linux.xshmgetimage while building the documentation.
import mmap
if not hasattr(mmap, "PROT_READ"):
mmap.PROT_READ = 1 # type:ignore[attr-defined]
import mss
# -- General configuration ------------------------------------------------
extensions = [
"sphinx.ext.autodoc",
"sphinx_copybutton",
"sphinx.ext.intersphinx",
"sphinx_new_tab_link",
]
templates_path = ["_templates"]
source_suffix = {".rst": "restructuredtext"}
master_doc = "index"
new_tab_link_show_external_link_icon = True
# General information about the project.
project = "Python MSS"
copyright = f"{mss.__date__}, {mss.__author__} & contributors" # noqa:A001
author = mss.__author__
version = mss.__version__
release = "latest"
language = "en"
todo_include_todos = True
autodoc_member_order = "bysource"
autodoc_default_options = {
"members": True,
"undoc-members": True,
"show-inheritance": True,
}
# Suppress duplicate target warnings for re-exported classes
suppress_warnings = ["ref.python"]
# Monkey-patch WINFUNCTYPE and WinError into ctypes, so that we can
# import mss.windows while building the documentation.
ctypes.WINFUNCTYPE = ctypes.CFUNCTYPE # type:ignore[attr-defined]
ctypes.WinError = lambda _code=None, _descr=None: OSError() # type:ignore[attr-defined]
# -- Options for HTML output ----------------------------------------------
html_theme = "shibuya"
html_theme_options = {
"accent_color": "lime",
"globaltoc_expand_depth": 1,
"toctree_titles_only": False,
}
html_favicon = "../icon.png"
html_context = {
"source_type": "github",
"source_user": "BoboTiG",
"source_repo": "python-mss",
"source_docs_path": "/docs/source/",
"source_version": "main",
}
htmlhelp_basename = "PythonMSSdoc"
# -- Options for Epub output ----------------------------------------------
# Bibliographic Dublin Core info.
epub_title = project
epub_author = author
epub_publisher = author
epub_copyright = copyright
# A list of files that should not be packed into the epub file.
epub_exclude_files = ["search.html"]
# ----------------------------------------------
# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {"python": ("https://docs.python.org/3", None)}