diff --git a/template/Makefile b/template/Makefile index 382c8b8..adc04b7 100644 --- a/template/Makefile +++ b/template/Makefile @@ -13,6 +13,21 @@ check: ## Run code quality tools. @echo "🚀 Static type checking: Running ty" @uv run ty check +.PHONY: release-dry +release-dry: ## Simulate the release process and show the next version + @echo "🚀 Simulating release process..." + @uv run semantic-release --noop version --print + +.PHONY: release-stable +release-stable: ## Prepare project for stable 1.0.0 release (disables 0.x.x versions) + @echo "🚀 Preparing for stable release..." + @sed -i 's/allow_zero_version = true/allow_zero_version = false/' pyproject.toml + @echo "Updated pyproject.toml: allow_zero_version = false" + @echo "Next steps:" + @echo " 1. git add pyproject.toml" + @echo " 2. git commit -m 'chore: prepare for stable 1.0.0 release'" + @echo " 3. Push to main - the next feat/fix commit will trigger 1.0.0" + .PHONY: test test: ## Test the code with pytest @echo "🚀 Testing code: Running pytest" diff --git a/template/pyproject.toml.jinja b/template/pyproject.toml.jinja index 8ffb2cf..1b66214 100644 --- a/template/pyproject.toml.jinja +++ b/template/pyproject.toml.jinja @@ -1,6 +1,6 @@ [project] name = "{{ project_name }}" -version = "0.0.1" +version = "0.0.0" description = "{{ project_description }}" authors = [{name = "{{ author_username }}", email = "{{ author_email }}"}] requires-python = ">=3.10" @@ -24,6 +24,7 @@ dev = [ "ty>=0.0.1a16", "ruff>=0.11.5", "pytest>=7.2.0", + "python-semantic-release>=10.5.3", ] [tool.pytest.ini_options] @@ -55,6 +56,18 @@ build_command = """ uv build """ +# Commit parser - this should be at the top level +commit_parser = "conventional" + +# Allow 0.x.x versions (prevents jumping straight to 1.0.0) +allow_zero_version = true + +# Don't do major version bumps when in 0.x.x +major_on_zero = false + +# Tag format +tag_format = "v{version}" + [tool.semantic_release.changelog] exclude_commit_patterns = [ '''chore(?:\([^)]*?\))?: .+''',