forked from speechmatics/speechmatics-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
95 lines (76 loc) · 2.53 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
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
86
87
88
89
90
91
92
93
94
95
#!/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/',
license='MIT',
author='Speechmatics',
author_email='[email protected]',
description='Python library and CLI 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'
]
},
project_urls={
'Documentation': 'https://speechmatics.github.io/speechmatics-python/',
'Source Code': 'https://github.com/speechmatics/speechmatics-python/',
},
classifiers=[
"Environment :: Console",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Topic :: Multimedia :: Sound/Audio :: Speech",
"Topic :: Software Development :: Libraries :: Python Modules",
],
include_package_data=True,
python_requires='>=3.7',
)