-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
39 lines (31 loc) · 1.29 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
from setuptools import setup, find_packages
from os import path, getenv
def get_requirements(requirements_filename: str):
requirements_file = path.join(path.abspath(path.dirname(__file__)), "requirements", requirements_filename)
with open(requirements_file, 'r', encoding='utf-8') as r:
requirements = r.readlines()
requirements = [r.strip() for r in requirements if r.strip() and not r.strip().startswith("#")]
for i in range(0, len(requirements)):
r = requirements[i]
if "@" in r:
parts = [p.lower() if p.strip().startswith("git+http") else p for p in r.split('@')]
r = "@".join(parts)
if getenv("GITHUB_TOKEN"):
if "github.com" in r:
r = r.replace("github.com", f"{getenv('GITHUB_TOKEN')}@github.com")
requirements[i] = r
return requirements
with open("./version.py", "r", encoding="utf-8") as v:
for line in v.readlines():
if line.startswith("__version__"):
if '"' in line:
version = line.split('"')[1]
else:
version = line.split("'")[1]
setup(
name='streaming-stt-nemo',
version=version,
packages=find_packages(),
python_requires='>3.7.0',
install_requires=get_requirements("requirements.txt"),
)