forked from speechmatics/speechmatics-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
85 lines (66 loc) · 2.07 KB
/
setup.py
File metadata and controls
85 lines (66 loc) · 2.07 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/usr/bin/env python3
"""
Setuptools configuration for Speechmatics
"""
import os
import logging
from setuptools import setup
def read(fname):
"""
Load content of the file with path relative to where setup.py is.
Args:
fname (str): file name (or path relative to the project root)
Returns:
str: file content
"""
fpath = os.path.join(os.path.dirname(os.path.abspath(__file__)), fname)
retval = open(fpath).read()
return retval
def read_list(fname):
"""
Load content of the file and split it into a list of lines.
Args:
fname (str): file name (or path relative to the project root)
Returns:
List[str]: file content (one string per line) with end of lines
characters stripped off and empty lines filtered out
"""
content = read(fname)
retval = list(filter(None, content.split('\n')))
return retval
def get_version(fname):
"""
Retrieve version from the VERSION file.
Args:
fname (str): file containing only the version
Returns:
str: version with whitespace characters stripped off
"""
return read(fname).strip()
logging.basicConfig(level=logging.INFO)
setup(
name='speechmatics-python',
version=os.getenv('VERSION', get_version('VERSION')),
packages=['speechmatics'],
url='https://github.com/speechmatics/speechmatics-python.git',
license='MIT',
author='Speechmatics',
author_email='support@speechmatics.com',
description='Python API client for Speechmatics',
long_description=read('README.md'),
long_description_content_type='text/markdown',
install_requires=read_list('requirements.txt'),
tests_require=read_list('requirements-dev.txt'),
entry_points={
'console_scripts': [
'speechmatics = speechmatics.cli:main'
]
},
classifiers=[
"Environment :: Console",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Topic :: Multimedia :: Sound/Audio :: Speech"
],
include_package_data=True,
)