Skip to content

Replace hardcoded version with release tag-based versioning - #7

Merged
tingiskhan merged 2 commits into
masterfrom
claude/use-release-tags-versioning-0nJOV
Mar 26, 2026
Merged

Replace hardcoded version with release tag-based versioning#7
tingiskhan merged 2 commits into
masterfrom
claude/use-release-tags-versioning-0nJOV

Conversation

@tingiskhan

Copy link
Copy Markdown
Owner
  • pyproject.toml: switch to dynamic = ["version"] so maturin reads from Cargo.toml
  • release.yml: add step to patch Cargo.toml version from the git tag (GITHUB_REF_NAME) before building wheels and sdist
  • init.py: use importlib.metadata.version() instead of hardcoded string

https://claude.ai/code/session_01VuQFDGxWFdbVyvxRiNiftQ

- pyproject.toml: switch to dynamic = ["version"] so maturin reads from Cargo.toml
- release.yml: add step to patch Cargo.toml version from the git tag (GITHUB_REF_NAME) before building wheels and sdist
- __init__.py: use importlib.metadata.version() instead of hardcoded string

https://claude.ai/code/session_01VuQFDGxWFdbVyvxRiNiftQ
Copilot AI review requested due to automatic review settings March 26, 2026 14:03

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR switches rustypca to tag-driven, single-source versioning by deriving the Python package version from Cargo.toml (via maturin) and ensuring release builds patch Cargo.toml from the Git tag.

Changes:

  • Make pyproject.toml version dynamic so maturin reads the version from Cargo.toml.
  • Update the GitHub release workflow to set Cargo.toml’s version from GITHUB_REF_NAME before building wheels/sdist.
  • Replace the hardcoded __version__ with importlib.metadata.version() lookup at runtime.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
rustypca/__init__.py Uses package metadata to populate __version__ instead of a hardcoded string.
pyproject.toml Switches to dynamic = ["version"] to source version from maturin/Cargo.
.github/workflows/release.yml Patches Cargo.toml version from the release tag prior to building/publishing artifacts.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/release.yml
Comment thread .github/workflows/release.yml
@tingiskhan

Copy link
Copy Markdown
Owner Author

@claude Fix comments that copilot pointed out

Add a version input to workflow_dispatch so manual runs can supply an
explicit version. Fall back to the git tag name when triggered by a push.
Validate the resolved value against a semver regex and fail early with a
clear message rather than silently writing an invalid version into Cargo.toml.

https://claude.ai/code/session_01VuQFDGxWFdbVyvxRiNiftQ
@tingiskhan
tingiskhan merged commit d14a507 into master Mar 26, 2026
13 checks passed
@tingiskhan
tingiskhan deleted the claude/use-release-tags-versioning-0nJOV branch March 26, 2026 21:00
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.

3 participants