Commits

Denis Darii  committed 405b391

added VERSION in vostok_satellite app __init__.py file

  • Participants
  • Parent commits 31f219f

Comments (0)

Files changed (1)

File vostok_satellite/__init__.py

+__import__("pkg_resources").declare_namespace(__name__)
+VERSION = (0, 0, 1, 'alpha', 1)
+
+
+def get_version(version=None):
+    """Derives a PEP386-compliant version number from VERSION."""
+    if version is None:
+        version = VERSION
+    assert len(version) == 5
+    assert version[3] in ('alpha', 'beta', 'rc', 'final')
+
+    # Now build the two parts of the version number:
+    # main = X.Y[.Z]
+    # sub = .devN - for pre-alpha releases
+    #     | {a|b|c}N - for alpha, beta and rc releases
+
+    parts = 2 if version[2] == 0 else 3
+    return '.'.join(str(x) for x in version[:parts])