Coverage for orcanet/__version__.py: 54%

13 statements  

« prev     ^ index     » next       coverage.py v6.4.1, created at 2022-06-10 14:33 +0000

1#!/usr/bin/env python 

2# Filename: __version__.py 

3# pylint: disable=C0103 

4""" 

5Pep 386 compliant version info. 

6 

7 (major, minor, micro, alpha/beta/rc/final, #) 

8 (1, 1, 2, 'alpha', 0) => "1.1.2.dev" 

9 (1, 2, 0, 'beta', 2) => "1.2b2" 

10 

11""" 

12from __future__ import absolute_import, print_function, division 

13from os.path import dirname, realpath, join 

14from setuptools_scm import get_version 

15 

16version = "unknown version" 

17 

18try: 

19 version = get_version(root="..", relative_to=__file__) 

20except LookupError: 

21 try: 

22 with open(join(realpath(dirname(__file__)), "version.txt"), "r") as fobj: 

23 version = fobj.read() 

24 except IOError: 

25 pass