File: conf.py

package info (click to toggle)
mplcursors 0.6-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 400 kB
  • sloc: python: 1,915; makefile: 14; sh: 9
file content (108 lines) | stat: -rw-r--r-- 2,657 bytes parent folder | download | duplicates (2)
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
import os
from pathlib import Path
import re
import sys
import mplcursors

# -- General configuration ------------------------------------------------

extensions = [
    'sphinx.ext.autodoc',
    'sphinx.ext.autosummary',
    'sphinx.ext.coverage',
    'sphinx.ext.intersphinx',
    'sphinx.ext.napoleon',
    'sphinx.ext.viewcode',
    'sphinx_gallery.gen_gallery',
]

source_suffix = '.rst'
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
master_doc = 'index'

project = 'mplcursors'
copyright = '2016–present, Antony Lee'
author = 'Antony Lee'

# RTD modifies conf.py, making setuptools_scm mark the version as -dirty.
version = release = re.sub(r'\.dirty$', '', mplcursors.__version__)

language = 'en'

default_role = 'any'

pygments_style = 'sphinx'

todo_include_todos = False

python_use_unqualified_type_names = True

# -- Options for HTML output ----------------------------------------------

html_theme = 'pydata_sphinx_theme'
html_theme_options = {
    'github_url': 'https://github.com/anntzer/mplcursors',
}
html_css_files = ['hide_some_gallery_elements.css']
html_static_path = ['_static']

htmlhelp_basename = 'mplcursors_doc'

# -- Options for LaTeX output ---------------------------------------------

latex_elements = {}
latex_documents = [(
    master_doc,
    'mplcursors.tex',
    'mplcursors Documentation',
    'Antony Lee',
    'manual',
)]

# -- Options for manual page output ---------------------------------------

man_pages = [(
    master_doc,
    'mplcursors',
    'mplcursors Documentation',
    [author],
    1,
)]

# -- Options for Texinfo output -------------------------------------------

texinfo_documents = [(
    master_doc,
    'mplcursors',
    'mplcursors Documentation',
    author,
    'mplcursors',
    'Interactive data selection cursors for Matplotlib.',
    'Miscellaneous',
)]

# -- Misc. configuration --------------------------------------------------

autodoc_member_order = 'bysource'

intersphinx_mapping = {
    'python': ('https://docs.python.org/3', None),
    'matplotlib': ('https://matplotlib.org/stable', None),
    'pandas': ('https://pandas.pydata.org/pandas-docs/stable', None),
}

# CustomSortKey cannot be defined *here* because it would be unpicklable as
# this file is exec'd rather than imported.
sys.path.append(".")
from _local_ext import CustomSortKey

os.environ.pop("DISPLAY", None)  # Don't warn about non-GUI when running s-g.

sphinx_gallery_conf = {
    'backreferences_dir': None,
    'examples_dirs': '../../examples',
    'filename_pattern': r'.*\.py',
    'gallery_dirs': 'examples',
    'min_reported_time': 1,
    'within_subsection_order': CustomSortKey,
}