Skip to content

Commit

Permalink
Fix current_version for all branches
Browse files Browse the repository at this point in the history
  • Loading branch information
mdellweg committed Nov 25, 2024
1 parent 78ad960 commit e956901
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion templates/github/.ci/scripts/check_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ def template_config():
def current_version(repo, commitish):
try:
pyproject_toml = tomllib.loads(repo.git.show(f"{commitish}:pyproject.toml"))
current_version = pyproject_toml["project"]["version"]
try:
current_version = pyproject_toml["project"]["version"]
except Exception:
current_version = pyproject_toml["tool"]["bumpversion"]["current_version"]
except Exception:
current_version = repo.git.grep(
"current_version", commitish, "--", ".bumpversion.cfg"
Expand Down
5 changes: 4 additions & 1 deletion utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ def current_version(plugin_root_path):
try:
path = plugin_root_path / "pyproject.toml"
pyproject_toml = tomllib.loads(path.read_text())
current_version = pyproject_toml["project"]["version"]
try:
current_version = pyproject_toml["project"]["version"]
except Exception:
current_version = pyproject_toml["tool"]["bumpversion"]["current_version"]
except Exception:
try:
path = plugin_root_path / ".bumpversion.cfg"
Expand Down

0 comments on commit e956901

Please sign in to comment.