|
5 | 5 | import os |
6 | 6 | import sys |
7 | 7 |
|
| 8 | +try: |
| 9 | + from importlib import metadata |
| 10 | +except ImportError: |
| 11 | + import importlib_metadata as metadata |
| 12 | + |
8 | 13 | # path to autogen'ed modules |
9 | 14 | sys.path.append(os.path.abspath('..')) |
10 | | - |
11 | | -# mock out some extension modules |
12 | | -class Mock: |
13 | | - def __init__(self, *args, **kwargs): |
14 | | - pass |
15 | | - |
16 | | - def __call__(self, *args, **kwargs): |
17 | | - return Mock() |
18 | | - |
19 | | - @classmethod |
20 | | - def __getattr__(self, name): |
21 | | - if name in ('__file__', '__path__'): |
22 | | - return '/dev/null' |
23 | | - elif name[0] == name[0].upper(): |
24 | | - return type(name, (), {}) |
25 | | - else: |
26 | | - return Mock() |
27 | | - |
28 | | -for mod_name in [ 'sympy', 'numpy', 'pyweno.codeprinters', 'pyweno.ccoeffs', 'pyweno.cweno' ]: |
29 | | - sys.modules[mod_name] = Mock() |
| 15 | +m = metadata.metadata('PyWENO') |
30 | 16 |
|
31 | 17 | # extentions |
32 | | -extensions = ['sphinx.ext.autodoc', 'sphinx.ext.mathjax'] |
| 18 | +extensions = [ |
| 19 | + 'sphinx.ext.autodoc', |
| 20 | + 'sphinx.ext.mathjax', |
| 21 | + ] |
33 | 22 |
|
34 | 23 | # general configuration |
35 | 24 | source_suffix = '.rst' |
36 | 25 | master_doc = 'index' |
37 | 26 |
|
38 | 27 | # html configuration |
39 | 28 | pygments_style = 'sphinx' |
40 | | -html_theme = 'default' |
| 29 | +html_theme = 'sphinx_rtd_theme' |
41 | 30 |
|
42 | 31 | html_sidebars = { |
43 | 32 | '**': ['globaltoc.html', 'searchbox.html'], |
44 | 33 | } |
45 | 34 |
|
46 | 35 | # project information |
47 | | -project = 'PyWENO' |
48 | | -copyright = '2009, 2010, 2011, Matthew Emmett' |
49 | | - |
50 | | -with open('../version.py') as f: |
51 | | - exec(f.read()) # this sets 'version' |
52 | | -release = version |
| 36 | +project = m['Name'] |
| 37 | +author = m['Author-email'] |
| 38 | +copyright = f'2009, 2010, 2011 {author}' |
| 39 | +release = m['Version'] |
0 commit comments