Skip to content

chore: migrate versioning to setuptools_scm#19

Merged
eman merged 7 commits intomainfrom
release/0.4.0
Feb 22, 2026
Merged

chore: migrate versioning to setuptools_scm#19
eman merged 7 commits intomainfrom
release/0.4.0

Conversation

@eman
Copy link
Copy Markdown
Owner

@eman eman commented Feb 21, 2026

Summary

Replaces the manual bump2version versioning workflow with setuptools_scm, which derives the package version automatically from git tags.

Changes

pyproject.toml

  • Added setuptools_scm>=8.0 to [build-system].requires
  • Replaced static version = "..." with dynamic = ["version"]
  • Added [tool.setuptools_scm] config (post-release scheme, no local version suffix)
  • Removed bump2version from dev dependencies

src/alpha_hwr/__init__.py

  • Replaced hardcoded __version__ = "..." with importlib.metadata.version() lookup

.github/workflows/publish.yml

  • Changed trigger from push: tags: v* to release: types: [published]
  • Removed manual version-vs-tag verification step (no longer needed)
  • Added setuptools_scm to the pip install step

CONTRIBUTING.md

  • Updated release process: remove bump2version steps, document new git tag + GitHub Release workflow

tests/test_version_consistency.py

  • Replaced bump2version-specific tests with checks that verify the setuptools_scm configuration is correct

.bumpversion.cfg — deleted

Release workflow (new)

git tag v0.5.1
git push --tags
# Then create a GitHub Release from that tag — PyPI publish triggers automatically

Copilot AI review requested due to automatic review settings February 21, 2026 22:52
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment on lines +4 to +6
push:
tags:
- 'v*'
Copy link

Copilot AI Feb 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CONTRIBUTING.md file documents the release process as "Create a GitHub Release - this triggers PyPI publishing automatically" (line 202). However, this change modifies the workflow to trigger on tag push instead of GitHub release creation. The documentation in CONTRIBUTING.md should be updated to reflect this new workflow. For example, step 4 could be changed to: "Push tags: git push --tags - this triggers PyPI publishing automatically" and remove the GitHub release creation step, or clarify that GitHub releases are optional.

Suggested change
push:
tags:
- 'v*'
release:
types:
- published

Copilot uses AI. Check for mistakes.
GitHub Copilot added 3 commits February 21, 2026 14:57
- Replace static version in pyproject.toml with dynamic setuptools_scm
- Add setuptools_scm>=8.0 to build-system requires
- Add [tool.setuptools_scm] config (post-release scheme, no local version)
- Replace hardcoded __version__ with importlib.metadata lookup
- Remove version verification step from publish workflow (no longer needed)
- Delete .bumpversion.cfg
…NG.md

- Change publish workflow trigger from push:tags to release:published
- Update CONTRIBUTING.md to remove bump2version, reflect new release steps
Replace bump2version-specific tests with checks that verify:
- pyproject.toml uses dynamic version (not static)
- setuptools_scm is configured in pyproject.toml
- __init__.py uses importlib.metadata (not hardcoded string)
@eman eman changed the title release on tag chore: migrate versioning to setuptools_scm Feb 21, 2026
@eman eman merged commit 4ba592a into main Feb 22, 2026
6 checks passed
@eman eman deleted the release/0.4.0 branch February 22, 2026 00:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants