forked from hyperledger/indy-node
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathversion.py
32 lines (20 loc) · 933 Bytes
/
version.py
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
32
from typing import Type
from common.version import (
DigitDotVersion, SourceVersion, PackageVersion
)
from indy_common.constants import APP_NAME
from indy_common.node_version import NodeVersion
NodeVersion = NodeVersion
# Rich Schema
class ContextVersion(DigitDotVersion):
def __init__(self, version: str, **kwargs):
super().__init__(version, parts_num=(2, 3), **kwargs)
class SchemaVersion(DigitDotVersion):
def __init__(self, version: str, **kwargs):
super().__init__(version, parts_num=(2, 3), **kwargs)
class TopPkgDefVersion(DigitDotVersion, SourceVersion):
def __init__(self, version: str, **kwargs):
super().__init__(version, parts_num=(2, 3), **kwargs)
def src_version_cls(pkg_name: str = APP_NAME) -> Type[SourceVersion]:
# TODO implement dynamic class resolving depending on packge name and config
return NodeVersion if pkg_name == APP_NAME else TopPkgDefVersion