Completed
Pull Request — master (#2116)
by Lasse
01:55
created

get_version()   A

Complexity

Conditions 2

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %
Metric Value
cc 2
dl 0
loc 3
rs 10
1
import sys
2
from os.path import join, dirname
3
4
5
VERSION_FILE = join(dirname(__file__), "VERSION")
6
7
8
def get_version():
9
    with open(VERSION_FILE, 'r') as ver:
10
        return ver.readline().strip()
11
12
13
VERSION = get_version()
14
__version__ = VERSION
15
16
# Needed by setup.py and thus cannot live in Constants as it contains the
17
# appdirs import that will break setup if appdirs isn't available yet.
18
BUS_NAME = "org.coala_analyzer.v1"
19
20
21
def assert_supported_version():  # pragma: no cover
22
    if not sys.version_info > (3, 2):
23
        print("coala supports only python 3.3 or later.")
24
        exit(4)
25