forked from resemble-ai/resemble-enhance
-
Notifications
You must be signed in to change notification settings - Fork 3
/
setup.py
53 lines (41 loc) · 1.58 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
import subprocess
from datetime import datetime, timezone
from pathlib import Path
from setuptools import find_packages, setup
def shell(*args):
out = subprocess.check_output(args)
return out.decode("ascii").strip()
def write_version(version_core, pre_release=True):
if pre_release:
last_commit_time = shell("git", "log", "-1", "--format=%cd", "--date=iso-strict")
last_commit_time = datetime.strptime(last_commit_time, "%Y-%m-%dT%H:%M:%S%z")
last_commit_time = last_commit_time.astimezone(timezone.utc)
last_commit_time = last_commit_time.strftime("%y%m%d%H%M%S")
version = f"{version_core}-dev{last_commit_time}"
else:
version = version_core
with open(Path("resemble_enhance", "version.py"), "w") as f:
f.write('__version__ = "{}"\n'.format(version))
return version
with open("README.md", "r") as f:
long_description = f.read()
with open("requirements.txt", "r") as f:
requirements = f.read().splitlines()
setup(
name="resemble-enhance",
python_requires=">=3.10",
version=write_version("0.0.2", pre_release=True),
description="Speech denoising and enhancement with deep learning",
long_description=long_description,
long_description_content_type="text/markdown",
packages=find_packages(),
install_requires=requirements,
url="https://github.com/resemble-ai/resemble-enhance",
author="Resemble AI",
entry_points={
"console_scripts": [
"resemble-enhance=resemble_enhance.enhancer.__main__:main",
]
},
)