Skip to content

Commit e3b3b1c

Browse files
committed
use setup.py --version by default
1 parent 9087040 commit e3b3b1c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

jupyter_releaser/util.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,10 @@ def get_repo():
137137

138138
def get_version():
139139
"""Get the current package version"""
140+
if SETUP_PY.exists():
141+
warnings.warn("Using deprecated setup.py invocation")
142+
return run("python setup.py --version").split("\n")[-1]
143+
140144
if PYPROJECT.exists():
141145
text = PYPROJECT.read_text(encoding="utf-8")
142146
data = toml.loads(text)
@@ -153,10 +157,6 @@ def get_version():
153157
if PACKAGE_JSON.exists():
154158
return json.loads(PACKAGE_JSON.read_text(encoding="utf-8")).get("version", "")
155159

156-
if SETUP_PY.exists():
157-
warnings.warn("Using deprecated setup.py invocation")
158-
return run("python setup.py --version").split("\n")[-1]
159-
160160
raise ValueError("No version identifier could be found!")
161161

162162

0 commit comments

Comments
 (0)