Skip to content

Commit ebe2ea6

Browse files
committed
fix: sync version in __init__.py and improve release script
1 parent 38ca137 commit ebe2ea6

File tree

2 files changed

+24
-4
lines changed

2 files changed

+24
-4
lines changed

commitloom/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from .core.git import GitError, GitFile, GitOperations
66
from .services.ai_service import AIService, CommitSuggestion, TokenUsage
77

8-
__version__ = "1.5.3"
8+
__version__ = "1.5.4"
99
__author__ = "Petru Arakiss"
1010
__email__ = "petruarakiss@gmail.com"
1111

release.py

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,14 +166,34 @@ def create_github_release(version: str, dry_run: bool = False) -> None:
166166
else:
167167
print(f"Would create tag: {tag}")
168168

169+
def update_init_version(new_version: str) -> None:
170+
"""Update version in __init__.py file."""
171+
init_file = Path("commitloom/__init__.py")
172+
173+
with open(init_file) as f:
174+
content = f.read()
175+
176+
# Update the version line
177+
updated_content = re.sub(
178+
r'__version__ = "[^"]*"',
179+
f'__version__ = "{new_version}"',
180+
content
181+
)
182+
183+
with open(init_file, "w") as f:
184+
f.write(updated_content)
185+
169186
def create_version_commits(new_version: str) -> None:
170187
"""Create granular commits for version changes."""
171-
# 1. Update version in pyproject.toml
172-
run_command('git add pyproject.toml')
188+
# 1. Update version in __init__.py
189+
update_init_version(new_version)
190+
191+
# 2. Add both version files and commit
192+
run_command('git add pyproject.toml commitloom/__init__.py')
173193
run_command(f'git commit -m "build: bump version to {new_version}"')
174194
print("✅ Committed version bump")
175195

176-
# 2. Update changelog
196+
# 3. Update changelog
177197
update_changelog(new_version)
178198
run_command('git add CHANGELOG.md')
179199
run_command(f'git commit -m "docs: update changelog for {new_version}"')

0 commit comments

Comments
 (0)