Skip to content
This repository was archived by the owner on Jan 2, 2026. It is now read-only.

Commit 80ecde2

Browse files
committed
feat(release): add bump-my-version for version management
- Add bump-my-version to dev dependencies - Configure version files: __init__.py, plugin.json, marketplace.json - Add Makefile targets: bump, bump-patch, bump-minor, bump-major - Add bump-dry for previewing changes, version for showing current - Auto-commits and tags releases with conventional commit format
1 parent ec9f075 commit 80ecde2

3 files changed

Lines changed: 378 additions & 1 deletion

File tree

Makefile

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: help install install-dev test test-cov lint typecheck security coverage format format-check clean build quality
1+
.PHONY: help install install-dev test test-cov lint typecheck security coverage format format-check clean build quality bump bump-patch bump-minor bump-major bump-dry version
22

33
.DEFAULT_GOAL := help
44

@@ -21,6 +21,9 @@ help: ## Show this help message
2121
@echo 'Build:'
2222
@grep -E '^(build|clean):.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-18s\033[0m %s\n", $$1, $$2}'
2323
@echo ''
24+
@echo 'Release:'
25+
@grep -E '^(bump|bump-patch|bump-minor|bump-major|bump-dry|version):.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-18s\033[0m %s\n", $$1, $$2}'
26+
@echo ''
2427

2528
install: ## Install package
2629
uv pip install -e .
@@ -85,3 +88,38 @@ build: ## Build distribution packages
8588
clean: ## Clean build artifacts
8689
rm -rf build/ dist/ *.egg-info .pytest_cache .mypy_cache .ruff_cache htmlcov/ .coverage
8790
find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
91+
92+
# =============================================================================
93+
# Release / Version Bumping
94+
# =============================================================================
95+
96+
version: ## Show current version
97+
@uv run bump-my-version show current_version
98+
99+
bump: bump-patch ## Bump version (alias for bump-patch)
100+
101+
bump-patch: ## Bump patch version (0.3.0 → 0.3.1)
102+
@echo "Bumping patch version..."
103+
uv run bump-my-version bump patch
104+
@echo ""
105+
@echo "✓ Version bumped. Don't forget to push with tags:"
106+
@echo " git push && git push --tags"
107+
108+
bump-minor: ## Bump minor version (0.3.0 → 0.4.0)
109+
@echo "Bumping minor version..."
110+
uv run bump-my-version bump minor
111+
@echo ""
112+
@echo "✓ Version bumped. Don't forget to push with tags:"
113+
@echo " git push && git push --tags"
114+
115+
bump-major: ## Bump major version (0.3.0 → 1.0.0)
116+
@echo "Bumping major version..."
117+
uv run bump-my-version bump major
118+
@echo ""
119+
@echo "✓ Version bumped. Don't forget to push with tags:"
120+
@echo " git push && git push --tags"
121+
122+
bump-dry: ## Show what would be bumped (dry run)
123+
@echo "Dry run - showing what would change for patch bump:"
124+
@echo ""
125+
uv run bump-my-version bump patch --dry-run --verbose --allow-dirty

pyproject.toml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ dev = [
4040
"pip-audit>=2.9.0",
4141
"build>=1.0.0",
4242
"types-PyYAML>=6.0.0",
43+
"bump-my-version>=1.1.0",
4344
]
4445

4546
[project.urls]
@@ -63,6 +64,7 @@ dev = [
6364
"pip-audit>=2.9.0",
6465
"build>=1.0.0",
6566
"types-PyYAML>=6.0.0",
67+
"bump-my-version>=1.1.0",
6668
]
6769

6870
# Hatch build configuration
@@ -174,3 +176,30 @@ fail_under = 80
174176
[tool.bandit]
175177
exclude_dirs = ["tests", ".venv", "venv"]
176178
skips = ["B101"] # assert_used OK in tests
179+
180+
# bump-my-version - Version Management
181+
[tool.bumpversion]
182+
current_version = "0.3.0"
183+
commit = true
184+
tag = true
185+
tag_name = "v{new_version}"
186+
tag_message = "Release v{new_version}"
187+
message = "chore(release): bump version {current_version} → {new_version}"
188+
allow_dirty = false
189+
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
190+
serialize = ["{major}.{minor}.{patch}"]
191+
192+
[[tool.bumpversion.files]]
193+
filename = "src/git_notes_memory/__init__.py"
194+
search = '__version__ = "{current_version}"'
195+
replace = '__version__ = "{new_version}"'
196+
197+
[[tool.bumpversion.files]]
198+
filename = "plugin.json"
199+
search = '"version": "{current_version}"'
200+
replace = '"version": "{new_version}"'
201+
202+
[[tool.bumpversion.files]]
203+
filename = ".claude-plugin/marketplace.json"
204+
search = '"version": "{current_version}"'
205+
replace = '"version": "{new_version}"'

0 commit comments

Comments
 (0)