File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change 66import importlib .metadata
77
88from packaging .specifiers import SpecifierSet
9+ from packaging .version import Version
910
1011project = "VWS-Python"
1112author = "Adam Dangoor"
3031copybutton_exclude = ".linenos, .gp"
3132
3233# The version info for the project you're documenting, acts as replacement for
33- # |version| and | release|, also used in various other places throughout the
34+ # |release|, also used in various other places throughout the
3435# built documents.
3536#
3637# Use ``importlib.metadata.version`` as per
37- # https://setuptools-scm.readthedocs.io/en/latest/usage/#usage-from-sphinx
38- version = importlib .metadata .version (distribution_name = project )
39- # This method of getting the release from the version goes hand in hand with
40- # the ``post- release`` versioning scheme chosen in the ``setuptools-scm``
41- # configuration .
42- release = version . split ( sep = ".post" )[ 0 ]
38+ # https://setuptools-scm.readthedocs.io/en/latest/usage/#usage-from-sphinx.
39+ _version_string = importlib .metadata .version (distribution_name = project )
40+ _version = Version ( version = _version_string )
41+ # GitHub release tags have the format YYYY.MM.DD, while Python requirement
42+ # versions may have the format YYYY.M.D for single digit months and days .
43+ release = "." . join ( f" { part :02d } " for part in _version . release )
4344
4445
4546project_metadata = importlib .metadata .metadata (distribution_name = project )
You can’t perform that action at this time.
0 commit comments