|
6 | 6 | import importlib.metadata
|
7 | 7 |
|
8 | 8 | from packaging.specifiers import SpecifierSet
|
9 |
| -from packaging.version import Version |
10 | 9 |
|
11 | 10 | project = "VWS-Python-Mock"
|
12 | 11 | author = "Adam Dangoor"
|
|
34 | 33 | # https://sphinx-copybutton.readthedocs.io/en/latest/use.html#automatic-exclusion-of-prompts-from-the-copies.
|
35 | 34 | copybutton_exclude = ".linenos, .gp"
|
36 | 35 |
|
37 |
| -# The version info for the project you're documenting, acts as replacement for |
38 |
| -# |release|, also used in various other places throughout the |
39 |
| -# built documents. |
40 |
| -# |
41 |
| -# Use ``importlib.metadata.version`` as per |
42 |
| -# https://setuptools-scm.readthedocs.io/en/latest/usage/#usage-from-sphinx. |
43 |
| -_version_string = importlib.metadata.version(distribution_name=project) |
44 |
| -_version = Version(version=_version_string) |
45 |
| -# GitHub release tags have the format YYYY.MM.DD, while Python requirement |
46 |
| -# versions may have the format YYYY.M.D for single digit months and days. |
47 |
| -release = ".".join(f"{part:02d}" for part in _version.release) |
48 |
| - |
49 | 36 | project_metadata = importlib.metadata.metadata(distribution_name=project)
|
50 | 37 | requires_python = project_metadata["Requires-Python"]
|
51 | 38 | specifiers = SpecifierSet(specifiers=requires_python)
|
|
90 | 77 |
|
91 | 78 | rst_prolog = f"""
|
92 | 79 | .. |project| replace:: {project}
|
93 |
| -.. |release| replace:: {release} |
94 | 80 | .. |minimum-python-version| replace:: {minimum_python_version}
|
95 | 81 | .. |github-owner| replace:: VWS-Python
|
96 | 82 | .. |github-repository| replace:: vws-python-mock
|
|
0 commit comments