-
-
Notifications
You must be signed in to change notification settings - Fork 85
/
Copy pathconf.py
90 lines (78 loc) · 2.37 KB
/
conf.py
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
from __future__ import annotations
extensions = [
'sphinx.ext.autodoc',
'jaraco.packaging.sphinx',
]
master_doc = "index"
html_theme = "furo"
# Link dates and other references in the changelog
extensions += ['rst.linker']
link_files = {
'../NEWS.rst': dict(
using=dict(GH='https://github.com'),
replace=[
dict(
pattern=r'(Issue #|\B#)(?P<issue>\d+)',
url='{package_url}/issues/{issue}',
),
dict(
pattern=r'(?m:^((?P<scm_version>v?\d+(\.\d+){1,2}))\n[-=]+\n)',
with_scm='{text}\n{rev[timestamp]:%d %b %Y}\n',
),
dict(
pattern=r'PEP[- ](?P<pep_number>\d+)',
url='https://peps.python.org/pep-{pep_number:0>4}/',
),
dict(
pattern=r'(python/cpython#|Python #)(?P<python>\d+)',
url='https://github.com/python/cpython/issues/{python}',
),
dict(
pattern=r'bpo-(?P<bpo>\d+)',
url='http://bugs.python.org/issue{bpo}',
),
],
)
}
# Be strict about any broken references
nitpicky = True
nitpick_ignore: list[tuple[str, str]] = []
# Include Python intersphinx mapping to prevent failures
# jaraco/skeleton#51
extensions += ['sphinx.ext.intersphinx']
intersphinx_mapping = {
'python': ('https://docs.python.org/3', None),
}
# Preserve authored syntax for defaults
autodoc_preserve_defaults = True
# Add support for linking usernames, PyPI projects, Wikipedia pages
github_url = 'https://github.com/'
extlinks = {
'user': (f'{github_url}%s', '@%s'),
'pypi': ('https://pypi.org/project/%s', '%s'),
'wiki': ('https://wikipedia.org/wiki/%s', '%s'),
}
extensions += ['sphinx.ext.extlinks']
# local
extensions += ['jaraco.tidelift']
intersphinx_mapping.update(
importlib_resources=(
'https://importlib-resources.readthedocs.io/en/latest/',
None,
),
)
intersphinx_mapping.update(
packaging=(
'https://packaging.python.org/en/latest/',
None,
),
)
nitpick_ignore += [
# Workaround for #316
('py:class', 'importlib_metadata.EntryPoints'),
('py:class', 'importlib_metadata.PackagePath'),
('py:class', 'importlib_metadata.SelectableGroups'),
('py:class', 'importlib_metadata._meta._T'),
# Workaround for #435
('py:class', '_T'),
]