File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 6
6
import importlib .metadata
7
7
8
8
from packaging .specifiers import SpecifierSet
9
+ from packaging .version import Version
9
10
10
11
project = "VWS-Python-Mock"
11
12
author = "Adam Dangoor"
34
35
copybutton_exclude = ".linenos, .gp"
35
36
36
37
# The version info for the project you're documenting, acts as replacement for
37
- # |version| and | release|, also used in various other places throughout the
38
+ # |release|, also used in various other places throughout the
38
39
# built documents.
39
40
#
40
41
# Use ``importlib.metadata.version`` as per
41
42
# https://setuptools-scm.readthedocs.io/en/latest/usage/#usage-from-sphinx.
42
- version = importlib .metadata .version (distribution_name = project )
43
- # This method of getting the release from the version goes hand in hand with
44
- # the ``post-release`` versioning scheme chosen in the ``setuptools-scm``
45
- # configuration.
46
- release = version .split (sep = ".post" )[0 ]
47
-
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
48
49
49
project_metadata = importlib .metadata .metadata (distribution_name = project )
50
50
requires_python = project_metadata ["Requires-Python" ]
You can’t perform that action at this time.
0 commit comments