File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -137,6 +137,13 @@ def get_repo():
137
137
138
138
def get_version ():
139
139
"""Get the current package version"""
140
+ if SETUP_PY .exists ():
141
+ warnings .warn ("Using deprecated setup.py invocation" )
142
+ try :
143
+ return run ("python setup.py --version" ).split ("\n " )[- 1 ]
144
+ except CalledProcessError as e :
145
+ print (e )
146
+
140
147
if PYPROJECT .exists ():
141
148
text = PYPROJECT .read_text (encoding = "utf-8" )
142
149
data = toml .loads (text )
@@ -153,10 +160,6 @@ def get_version():
153
160
if PACKAGE_JSON .exists ():
154
161
return json .loads (PACKAGE_JSON .read_text (encoding = "utf-8" )).get ("version" , "" )
155
162
156
- if SETUP_PY .exists ():
157
- warnings .warn ("Using deprecated setup.py invocation" )
158
- return run ("python setup.py --version" ).split ("\n " )[- 1 ]
159
-
160
163
raise ValueError ("No version identifier could be found!" )
161
164
162
165
You can’t perform that action at this time.
0 commit comments