-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathitkVersion.py
More file actions
31 lines (24 loc) · 875 Bytes
/
itkVersion.py
File metadata and controls
31 lines (24 loc) · 875 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from packaging.version import Version
# Version needs to be python PEP 440 compliant (no leading v)
VERSION = '6.0b1'.removeprefix("v")
def get_versions():
"""Returns versions for the ITK Python package.
from itkVersion import get_versions
# Returns the ITK repository version
get_versions()['version']
# Returns the package version. Since GitHub Releases do not support the '+'
# character in file names, this does not contain the local version
# identifier in nightly builds, i.e.
#
# '4.11.0.dev20170208'
#
# instead of
#
# '4.11.0.dev20170208+139.g922f2d9'
get_versions()['package-version']
"""
Version(VERSION) # Raise InvalidVersion exception if not PEP 440 compliant
versions = {}
versions['version'] = VERSION
versions['package-version'] = VERSION.split('+')[0]
return versions