forked from vanderschaarlab/autoprognosis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
43 lines (33 loc) · 1.01 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
"""
Setup file for autoprognosis.
Use setup.cfg to configure your project.
"""
# stdlib
import os
import re
# third party
from setuptools import setup
PKG_DIR = os.path.dirname(os.path.abspath(__file__))
def read(fname: str) -> str:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
def find_version() -> str:
version_file = read("src/autoprognosis/version.py")
version_re = r"__version__ = \"(?P<version>.+)\""
version_raw = re.match(version_re, version_file)
if version_raw is None:
return "0.0.1"
version = version_raw.group("version")
return version
if __name__ == "__main__":
try:
setup(
version=find_version(),
)
except: # noqa
print(
"\n\nAn error occurred while building the project, "
"please ensure you have the most updated version of setuptools, "
"setuptools_scm and wheel with:\n"
" pip install -U setuptools setuptools_scm wheel\n\n"
)
raise