Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions jupyter_releaser/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,13 @@ def get_repo():

def get_version():
"""Get the current package version"""
if SETUP_PY.exists():
warnings.warn("Using deprecated setup.py invocation")
try:
return run("python setup.py --version").split("\n")[-1]
except CalledProcessError as e:
print(e)

if PYPROJECT.exists():
text = PYPROJECT.read_text(encoding="utf-8")
data = toml.loads(text)
Expand All @@ -153,10 +160,6 @@ def get_version():
if PACKAGE_JSON.exists():
return json.loads(PACKAGE_JSON.read_text(encoding="utf-8")).get("version", "")

if SETUP_PY.exists():
warnings.warn("Using deprecated setup.py invocation")
return run("python setup.py --version").split("\n")[-1]

raise ValueError("No version identifier could be found!")


Expand Down