Skip to content

Commit 2e30e37

Browse files
committed
update setup.py
1 parent fa7b4a8 commit 2e30e37

File tree

2 files changed

+37
-2
lines changed

2 files changed

+37
-2
lines changed

setup.py

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,39 @@
1+
# stdlib
2+
import os
3+
import re
4+
5+
# third party
16
from setuptools import setup
27

8+
PKG_DIR = os.path.dirname(os.path.abspath(__file__))
9+
10+
11+
def read(fname: str) -> str:
12+
return open(os.path.join(os.path.dirname(__file__), fname)).read()
13+
14+
15+
def find_version() -> str:
16+
version_file = read("src/synthcity/version.py").split("\n")[0]
17+
version_re = r"__version__ = \"(?P<version>.+)\""
18+
version_raw = re.match(version_re, version_file)
19+
20+
if version_raw is None:
21+
return "0.0.1"
22+
23+
version = version_raw.group("version")
24+
return version
25+
26+
327
if __name__ == "__main__":
4-
setup()
28+
try:
29+
setup(
30+
version=find_version(),
31+
)
32+
except: # noqa
33+
print(
34+
"\n\nAn error occurred while building the project, "
35+
"please ensure you have the most updated version of setuptools, "
36+
"setuptools_scm and wheel with:\n"
37+
" pip install -U setuptools setuptools_scm wheel\n\n"
38+
)
39+
raise

src/data_suite/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "0.0.2"
1+
__version__ = "0.2.0"
22

33
MAJOR_VERSION = ".".join(__version__.split(".")[:-1])
44
PATCH_VERSION = __version__.split(".")[-1]

0 commit comments

Comments
 (0)