File: conf.py

package info (click to toggle)
python-gmpy2 2.2.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,996 kB
  • sloc: ansic: 24,604; python: 4,911; makefile: 123
file content (83 lines) | stat: -rw-r--r-- 2,957 bytes parent folder | download
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
"""
gmpy2 documentation build configuration file.

This file is execfile()d with the current directory set to its containing dir.

The contents of this file are pickled, so don't put values in the namespace
that aren't pickleable (module imports are okay, they're removed
automatically).
"""

import os
import sys

import packaging.version

import gmpy2

if sys.version_info < (3, 9):
    raise RuntimeError("Python version >= 3.9 required to build docs.")

# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.imgmath', 'sphinx.ext.doctest',
              'sphinx.ext.intersphinx', 'sphinx_rtd_theme']

# The name of a reST role (builtin or Sphinx extension) to use as the
# default role, that is, for text marked up `like this`.
default_role = 'py:obj'

# Sphinx will warn about all references where the target cannot be found.
nitpicky = True

# This value selects if automatically documented members are sorted
# alphabetical (value 'alphabetical'), by member type (value 'groupwise')
# or by source order (value 'bysource').
autodoc_member_order = 'groupwise'

# The default options for autodoc directives. They are applied to all
# autodoc directives automatically.
autodoc_default_options = {'members': True}

# Contains mapping the locations and names of other projects that
# should be linked to in this documentation.
intersphinx_mapping = {'python': ('https://docs.python.org/3/', None)}

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# General information about the project.
project = gmpy2.__package__
copyright = '2012 - 2024, Case Van Horsen'

gmpy2_version = packaging.version.parse(gmpy2.__version__)

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = f"{gmpy2_version.major}.{gmpy2_version.minor}"
# The full version, including alpha/beta/rc tags.
release = gmpy2.__version__

# The theme to use for HTML and HTML Help pages.  See the documentation for
# a list of builtin themes.
html_theme = 'sphinx_rtd_theme'

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [('index', 'gmpy2.tex', 'gmpy2 Documentation',
                    'Case Van Horsen', 'manual')]

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [('index', 'gmpy2', 'gmpy2 Documentation', ['Case Van Horsen'], 3)]

# Python code that is treated like it were put in a testcleanup directive
# for *every* file that is tested, and for every group.
doctest_global_cleanup = """
import gmpy2

gmpy2.set_context(gmpy2.context())
"""