|
6 | 6 |
|
7 | 7 | # -- Path setup -------------------------------------------------------------- |
8 | 8 |
|
9 | | -import configparser |
10 | 9 | import datetime |
11 | 10 | import os |
12 | 11 | import sys |
| 12 | +from importlib import metadata |
| 13 | + |
| 14 | +import toml |
13 | 15 |
|
14 | 16 | sys.path.insert(0, os.path.abspath(".")) |
15 | 17 | # modules that autodock should mock |
|
18 | 20 |
|
19 | 21 | # -- Project information ----------------------------------------------------- |
20 | 22 |
|
21 | | -_config = configparser.RawConfigParser() |
22 | | -_config.read(os.path.join("..", "setup.cfg")) |
23 | | -_meta = dict(_config.items("metadata")) |
| 23 | +toml_config = toml.load(os.path.join("..", "pyproject.toml")) |
| 24 | +project = toml_config["project"]["name"] |
| 25 | +author = ", ".join([a["name"] for a in toml_config["project"]["authors"]]) |
| 26 | +url = toml_config["project"]["urls"]["Homepage"] |
| 27 | +copyright = f'{datetime.datetime.now().date().strftime("%Y")}, {author}' |
24 | 28 |
|
25 | | -project = _meta["name"] |
26 | | -copyright = f'{datetime.datetime.now().date().strftime("%Y")}, {_meta["author"]}' |
27 | | -author = _meta["author"] |
28 | 29 |
|
29 | 30 | # The full version, including alpha/beta/rc tags |
30 | | -release = _meta["version"] |
| 31 | + |
| 32 | +release = metadata.version("fillname") |
31 | 33 |
|
32 | 34 | # -- General configuration --------------------------------------------------- |
33 | 35 |
|
34 | 36 | # Add any Sphinx extension module names here, as strings. They can be |
35 | 37 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom |
36 | 38 | # ones. Make sure that custom extensions are listed in the doc field of |
37 | | -# [options.extras_require] in setup.cfg so they are available when building |
| 39 | +# [options.extras_require] in project.toml so they are available when building |
38 | 40 | # the documentation. |
39 | 41 |
|
40 | 42 | extensions = [ |
|
70 | 72 | # This pattern also affects html_static_path and html_extra_path. |
71 | 73 | exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] |
72 | 74 |
|
73 | | -html_title = _meta["name"] |
| 75 | +html_title = project |
74 | 76 |
|
75 | 77 | # -- Options for HTML output ------------------------------------------------- |
76 | 78 |
|
|
86 | 88 | "footer_icons": [ |
87 | 89 | { |
88 | 90 | "name": "GitHub", |
89 | | - "url": _meta["url"], |
| 91 | + "url": url, |
90 | 92 | "html": """ |
91 | 93 | <svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 16 16"> |
92 | 94 | <path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z"></path> |
|
0 commit comments