|
| 1 | +import datetime as dt |
1 | 2 | import os |
| 3 | +import re |
2 | 4 | import sys |
3 | | -import datetime as dt |
| 5 | +from pathlib import Path |
| 6 | + |
| 7 | +MATCH_VERSION_LINE = re.compile(r"version = \W((\d+\.\d+)\.\d.*?)\W").fullmatch |
4 | 8 |
|
| 9 | +pyproject = Path(__file__).parent.parent / "pyproject.toml" |
| 10 | +version_line_match = next( |
| 11 | + filter(None, map(MATCH_VERSION_LINE, pyproject.read_text().splitlines())) |
| 12 | +) |
| 13 | +release, version = version_line_match.groups() |
5 | 14 |
|
6 | 15 | sys.path.insert(0, os.path.abspath("..")) |
7 | 16 |
|
8 | 17 | extensions = [ |
9 | | - 'sphinx.ext.autodoc', |
10 | | - 'sphinx.ext.intersphinx', |
11 | | - 'sphinx.ext.viewcode', |
12 | | - 'sphinx.ext.autosectionlabel', |
13 | | - 'sphinx_rtd_theme', |
| 18 | + "sphinx.ext.autodoc", |
| 19 | + "sphinx.ext.intersphinx", |
| 20 | + "sphinx.ext.viewcode", |
| 21 | + "sphinx.ext.autosectionlabel", |
| 22 | + "sphinx_rtd_theme", |
14 | 23 | ] |
15 | | -source_suffix = '.rst' |
16 | | -master_doc = 'index' |
17 | | - |
18 | | -project = u'Confuse' |
19 | | -copyright = '2012-{}, Adrian Sampson & contributors'.format( |
20 | | - dt.date.today().year |
21 | | -) |
| 24 | +source_suffix = ".rst" |
| 25 | +master_doc = "index" |
22 | 26 |
|
23 | | -version = '1.7' |
24 | | -release = '1.7.0' |
| 27 | +project = "Confuse" |
| 28 | +copyright = "2012-{}, Adrian Sampson & contributors".format(dt.date.today().year) |
25 | 29 |
|
26 | | -exclude_patterns = ['_build'] |
| 30 | +exclude_patterns = ["_build"] |
27 | 31 |
|
28 | | -pygments_style = 'sphinx' |
| 32 | +pygments_style = "sphinx" |
29 | 33 |
|
30 | 34 | # -- Options for HTML output -------------------------------------------------- |
31 | 35 |
|
32 | | -html_theme = 'sphinx_rtd_theme' |
33 | | -htmlhelp_basename = 'Confusedoc' |
| 36 | +html_theme = "sphinx_rtd_theme" |
| 37 | +htmlhelp_basename = "Confusedoc" |
0 commit comments