|
7 | 7 | # pylint: disable=invalid-name |
8 | 8 |
|
9 | 9 | import datetime |
10 | | -from email import message_from_string |
11 | | -from pathlib import Path |
12 | 10 |
|
13 | | -import pkg_resources |
| 11 | +import mock_vws |
| 12 | + |
| 13 | +project = 'VWS-Python-Mock' |
| 14 | +author = 'Adam Dangoor' |
14 | 15 |
|
15 | 16 | extensions = [ |
16 | 17 | 'sphinx.ext.autodoc', |
|
26 | 27 | source_suffix = '.rst' |
27 | 28 | master_doc = 'index' |
28 | 29 |
|
29 | | -docs_source_dir = Path(__file__).parent |
30 | | -docs_dir = docs_source_dir.parent |
31 | | -repo_dir = docs_dir.parent |
32 | | -src_dir = repo_dir / 'src' |
33 | | -distributions = {v.key: v for v in set(pkg_resources.working_set)} |
34 | | -(distribution, ) = { |
35 | | - dist |
36 | | - for dist in distributions.values() if dist.location == str(src_dir) |
37 | | -} |
38 | | -project_name = distribution.project_name |
39 | | - |
40 | | -pkg_info = distribution.get_metadata('PKG-INFO') |
41 | | -pkg_info_as_message = message_from_string(pkg_info) |
42 | | - |
43 | | -project = pkg_info_as_message['Name'] |
44 | | -author = pkg_info_as_message['Author'] |
45 | 30 | year = datetime.datetime.now().year |
46 | 31 | copyright = f'{year}, {author}' # pylint: disable=redefined-builtin |
47 | 32 |
|
48 | 33 | # The version info for the project you're documenting, acts as replacement for |
49 | 34 | # |version| and |release|, also used in various other places throughout the |
50 | 35 | # built documents. |
51 | | -version = distribution.version |
| 36 | +version = mock_vws.__version__ |
52 | 37 | release = version.split('+')[0] |
53 | 38 |
|
54 | 39 | substitutions = [ |
55 | 40 | ('|github-owner|', 'adamtheturtle'), |
56 | 41 | ('|github-repository|', 'vws-python-mock'), |
57 | 42 | ] |
58 | 43 |
|
59 | | - |
60 | 44 | language = None |
61 | 45 |
|
62 | 46 | # The name of the syntax highlighting style to use. |
|
0 commit comments