File tree Expand file tree Collapse file tree 2 files changed +37
-2
lines changed
Expand file tree Collapse file tree 2 files changed +37
-2
lines changed Original file line number Diff line number Diff line change 1+ # stdlib
2+ import os
3+ import re
4+
5+ # third party
16from 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+
327if __name__ == "__main__" :
4- setup ()
28+ try :
29+ setup (
30+ version = find_version (),
31+ )
32+ except : # noqa
33+ print (
34+ "\n \n An 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
Original file line number Diff line number Diff line change 1- __version__ = "0.0.2 "
1+ __version__ = "0.2.0 "
22
33MAJOR_VERSION = "." .join (__version__ .split ("." )[:- 1 ])
44PATCH_VERSION = __version__ .split ("." )[- 1 ]
You can’t perform that action at this time.
0 commit comments