-
Notifications
You must be signed in to change notification settings - Fork 3
/
setup.py
51 lines (43 loc) · 1.77 KB
/
setup.py
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
from setuptools import find_packages
from skbuild import setup
import os
import re
import shlex
import subprocess
import sys
TOP_DIR = os.path.realpath(os.path.dirname(__file__))
################################################################################
# Version
################################################################################
details = subprocess.check_output(shlex.split('git describe --tags --dirty'),
cwd=TOP_DIR).decode('ascii').strip()
details = details.rstrip()
is_dirty = '-dirty' in details
details = details.rstrip('-dirty')
try:
version_tag, commits_since_tag, current_hash = details.split('-')
current_hash = current_hash.lstrip('g')
except ValueError:
# Happens only when the latest tag points to the current commit
assert len(details.split('-')) == 1
version_tag = details
commits_since_tag = 0
current_hash = subprocess.check_output(
shlex.split('git rev-parse --short HEAD')).decode('ascii').strip()
assert re.match(r'^\d[.]\d[.]\d$', version_tag), 'Malformed version tag'
current_hash = current_hash + '.dirty' if is_dirty else current_hash
# This variable is specifically designed to meet the PEP440 standard.
version = "{0}.dev{1}+{2}".format(version_tag, commits_since_tag, current_hash)
setup_requires = ['tensorflow-gpu', 'pytest', 'pytest-runner']
setup(name='galvASR',
version=version,
description='Daniel Galvez\'s Automatic Speech Recognition Library',
packages=find_packages(),
cmake_args=['-DWITH_EXTERNAL_KALDI=third_party/kaldi/kaldi',
'-DUSE_TENSORFLOW=YES'],
tests_require=['pytest', 'pytest-runner'],
setup_requires=setup_requires,
install_requires=setup_requires,
extras_require={
'dev': ['ipython', 'matplotlib'],
})