-
Notifications
You must be signed in to change notification settings - Fork 12
/
setup.py
87 lines (69 loc) · 2.5 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
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import re
from datetime import datetime
from distutils.cmd import Command
from pathlib import Path
import setuptools
init_file_path = "physiopro/__init__.py"
def read(rel_path):
with open(Path(__file__).parent / rel_path, "r") as fp:
return fp.read()
def write(rel_path, content):
with open(Path(__file__).parent / rel_path, "w") as fp:
fp.write(content)
def get_version(rel_path):
for line in read(rel_path).splitlines():
if line.startswith("__version__"):
delim = '"' if '"' in line else "'"
return line.split(delim)[1]
raise RuntimeError("Unable to find version string.")
class BumpDevVersion(Command):
description = "Bump to dev version"
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
raw_content = read(init_file_path)
current_time = datetime.now().strftime("%Y%m%d%H%M%S")
pattern = r"__version__\s*=\s*(\'|\")([\d\.]+?)(\.(dev|a|b|rc).*?)?(\'|\")"
repl = re.sub(pattern, r"__version__ = '\2.dev" + current_time + "'", raw_content)
write(init_file_path, repl)
print(f"Version bumped to {get_version(init_file_path)}")
def setup():
setuptools.setup(
name="physiopro",
version=get_version(init_file_path),
author="PhysioPro team",
author_email="[email protected]",
description="A toolkit for time-series forecasting tasks",
long_description=read("README.md"),
long_description_content_type="text/markdown",
url="https://github.com/microsoft/physiopro",
packages=setuptools.find_packages(),
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
python_requires=">=3.8",
install_requires=[
"torch==2.0.1",
"torchvision==0.15.2",
"torchcde==0.2.5",
"utilsd==0.0.18.post0",
"pandas>=2.0.3",
"scipy>=1.10.1",
"sktime==0.21.0",
"tqdm>=4.42.1",
"tensorboard>=2.14.0",
"numba>=0.57.1",
"biosppy>=1.0.0",
],
extras_require={"dev": ["flake8", "pytest", "pytest-azurepipelines", "pytest-cov", "pylint"]},
cmdclass={"bumpver": BumpDevVersion},
)
if __name__ == "__main__":
setup()