|
2 | 2 | #
|
3 | 3 | # This file only contains a selection of the most common options. For a full
|
4 | 4 | # list see the documentation:
|
5 |
| -# http://www.sphinx-doc.org/en/master/config |
| 5 | +# https://www.sphinx-doc.org/en/master/usage/configuration.html |
6 | 6 |
|
7 | 7 | # -- Path setup --------------------------------------------------------------
|
8 | 8 |
|
| 9 | +import pathlib |
| 10 | + |
9 | 11 | # If extensions (or modules to document with autodoc) are in another directory,
|
10 | 12 | # add these directories to sys.path here. If the directory is relative to the
|
11 | 13 | # documentation root, use os.path.abspath to make it absolute, like shown here.
|
12 | 14 | #
|
13 |
| -import os |
14 |
| - |
| 15 | +# import os |
15 | 16 | # import sys
|
16 | 17 | # sys.path.insert(0, os.path.abspath('.'))
|
17 |
| - |
| 18 | +from configparser import ConfigParser |
18 | 19 |
|
19 | 20 | # -- Project information -----------------------------------------------------
|
20 |
| - |
21 | 21 | project = "tikzplotlib"
|
22 | 22 | copyright = "2010-2021, Nico Schlömer"
|
23 | 23 | author = "Nico Schlömer"
|
24 | 24 |
|
25 |
| -# https://packaging.python.org/single_source_version/ |
26 |
| -this_dir = os.path.abspath(os.path.dirname(__file__)) |
27 |
| -about = {} |
28 |
| -about_file = os.path.join(this_dir, "..", "tikzplotlib", "__about__.py") |
29 |
| -with open(about_file) as f: |
30 |
| - exec(f.read(), about) |
31 |
| -# The full version, including alpha/beta/rc tags. |
32 |
| -release = about["__version__"] |
33 |
| - |
34 |
| -# WARNING: conf value "version" should not be empty for EPUB3 |
35 |
| -version = about["__version__"] |
| 25 | +p = ConfigParser() |
| 26 | +this_dir = pathlib.Path(__file__).resolve().parent |
| 27 | +p.read(this_dir / ".." / "setup.cfg") |
| 28 | +release = p["metadata"]["version"] |
36 | 29 |
|
37 |
| -# for sphinx 1.* |
38 |
| -master_doc = "index" |
39 | 30 |
|
40 | 31 | # -- General configuration ---------------------------------------------------
|
41 | 32 |
|
42 | 33 | # Add any Sphinx extension module names here, as strings. They can be
|
43 | 34 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
44 | 35 | # ones.
|
45 |
| -extensions = [ |
46 |
| - "sphinx.ext.autodoc", |
47 |
| - "sphinx.ext.doctest", |
48 |
| - "sphinx.ext.todo", |
49 |
| - "sphinx.ext.coverage", |
50 |
| - "sphinx.ext.imgmath", |
51 |
| -] |
| 36 | +extensions = ["sphinx.ext.autodoc"] |
52 | 37 |
|
53 | 38 | # Add any paths that contain templates here, relative to this directory.
|
54 | 39 | templates_path = ["_templates"]
|
55 | 40 |
|
56 | 41 | # List of patterns, relative to source directory, that match files and
|
57 | 42 | # directories to ignore when looking for source files.
|
58 | 43 | # This pattern also affects html_static_path and html_extra_path.
|
59 |
| -exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] |
| 44 | +exclude_patterns = [] |
60 | 45 |
|
61 | 46 |
|
62 | 47 | # -- Options for HTML output -------------------------------------------------
|
|
0 commit comments