File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change 1+ __version__ = "1.0.2"
Original file line number Diff line number Diff line change 11import sys
22import warnings
3+ import os .path
34
45try :
56 from setuptools import setup
2526 install_requires .append ('idna' )
2627 install_requires .append ('requests[security]' )
2728
29+ def read (rel_path ):
30+ here = os .path .abspath (os .path .dirname (__file__ ))
31+ with open (os .path .join (here , rel_path ), 'r' ) as fp :
32+ return fp .read ()
33+
34+ def get_version (rel_path ):
35+ for line in read (rel_path ).splitlines ():
36+ if line .startswith ('__version__' ):
37+ delim = '"' if '"' in line else "'"
38+ return line .split (delim )[1 ]
39+ else :
40+ raise RuntimeError ("Unable to find a valid __version__ string in %s." % rel_path )
41+
2842setup (
2943 name = 'scaleapi' ,
3044 packages = ['scaleapi' ],
31- version = '1.0.2' ,
45+ version = get_version ( "scaleapi/_version.py" ) ,
3246 description = 'The official Python client library for Scale AI, the Data Platform for AI' ,
3347 author = 'Scale AI' ,
3448 author_email = 'support@scale.com' ,
You can’t perform that action at this time.
0 commit comments