File: version.py

package info (click to toggle)
theano 1.0.3+dfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 30,752 kB
  • sloc: python: 141,182; ansic: 9,505; makefile: 259; sh: 214; pascal: 81
file content (29 lines) | stat: -rw-r--r-- 627 bytes parent folder | download
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
from __future__ import absolute_import, print_function, division

from theano._version import get_versions

FALLBACK_VERSION = "1.0.3+unknown"

info = get_versions()
if info['error'] is not None:
    info['version'] = FALLBACK_VERSION

full_version = info['version']
git_revision = info['full-revisionid']
del get_versions

short_version = full_version.split('+')[0]


# This tries to catch a tag like beta2, rc1, ...
try:
    int(short_version.split('.')[2])
    release = True
except ValueError:
    release = False

if release and info['error'] is None:
    version = short_version
else:
    version = full_version
del info