File: version.py

package info (click to toggle)
python-hl7 0.4.5-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 508 kB
  • sloc: python: 3,833; makefile: 160
file content (31 lines) | stat: -rw-r--r-- 731 bytes parent folder | download | duplicates (2)
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
# -*- coding: utf-8 -*-

"""
Primary version number source.

Forth element can be 'dev' < 'a' < 'b' < 'rc' < 'final'. An empty 4th
element is equivalent to 'final'.
"""
VERSION = (0, 4, 5, "final")


def get_version():
    """Provide version number

    Use verlib format [1]_:
      N.N[.N]+[{a|b|c|rc}N[.N]+][.postN][.devN]

    .. [1] http://www.python.org/dev/peps/pep-0386/
    """
    main_version = "%s.%s.%s" % VERSION[0:3]

    if len(VERSION) < 4:
        return main_version

    version_type = VERSION[3]
    if not version_type or version_type == "final":
        return main_version
    elif version_type == "dev":
        return "%s.dev" % main_version
    else:
        return "%s%s" % (main_version, version_type)