|
11 | 11 | # All configuration values have a default; values that are commented out
|
12 | 12 | # serve to show the default.
|
13 | 13 |
|
14 |
| -import sys, os |
| 14 | +import datetime |
| 15 | +import os |
| 16 | +import re |
15 | 17 |
|
16 | 18 | # If extensions (or modules to document with autodoc) are in another directory,
|
17 | 19 | # add these directories to sys.path here. If the directory is relative to the
|
|
40 | 42 | master_doc = 'index'
|
41 | 43 |
|
42 | 44 | # General information about the project.
|
43 |
| -project = u'Pyobjus' |
44 |
| -copyright = u'2012, Mathieu Virbel, Gabriel Pettier' |
| 45 | +project = 'pyobjus' |
| 46 | + |
| 47 | +_today = datetime.datetime.now() |
| 48 | + |
| 49 | +copyright = f'{_today.year}, Mathieu Virbel, Gabriel Pettier' |
45 | 50 |
|
46 | 51 | # The version info for the project you're documenting, acts as replacement for
|
47 | 52 | # |version| and |release|, also used in various other places throughout the
|
48 | 53 | # built documents.
|
49 | 54 | #
|
| 55 | + |
| 56 | +# Lookup the version from the pyobjus module, without installing it |
| 57 | +# since readthedocs.org may have issue to install it. |
| 58 | +# Read the version from the __init__.py file, without importing it. |
| 59 | +def get_version(): |
| 60 | + with open( |
| 61 | + os.path.join(os.path.abspath("../.."), "pyobjus", "__init__.py") |
| 62 | + ) as fp: |
| 63 | + for line in fp: |
| 64 | + m = re.search(r'^\s*__version__\s*=\s*([\'"])([^\'"]+)\1\s*$', line) |
| 65 | + if m: |
| 66 | + return m.group(2) |
| 67 | + |
50 | 68 | # The short X.Y version.
|
51 |
| -version = '1.0' |
| 69 | +version = get_version() |
52 | 70 | # The full version, including alpha/beta/rc tags.
|
53 |
| -release = '1.0a1' |
| 71 | +release = get_version() |
54 | 72 |
|
55 | 73 | # The language for content autogenerated by Sphinx. Refer to documentation
|
56 | 74 | # for a list of supported languages.
|
|
91 | 109 |
|
92 | 110 | # The theme to use for HTML and HTML Help pages. See the documentation for
|
93 | 111 | # a list of builtin themes.
|
94 |
| -html_theme = 'default' |
| 112 | +html_theme = 'furo' |
95 | 113 |
|
96 | 114 | # Theme options are theme-specific and customize the look and feel of a theme
|
97 | 115 | # further. For a list of options available for each theme, see the
|
|
0 commit comments