Skip to content

ci: add an alpha input to the Bump Version workflow - #415

Open
TheGupta2012 wants to merge 2 commits into
mainfrom
ci/stamp-alpha-version
Open

ci: add an alpha input to the Bump Version workflow#415
TheGupta2012 wants to merge 2 commits into
mainfrom
ci/stamp-alpha-version

Conversation

@TheGupta2012

@TheGupta2012 TheGupta2012 commented Aug 25, 2026

Copy link
Copy Markdown
Member

Opens a development cycle, the step that has no automation behind it today.

Bump Version writes a plain version computed from the latest release, which is
right for a release commit. Nothing re-adds a suffix afterwards, so the repository
sits on a plain version between releases. That is what produced the recent
breakage: pyproject.toml held 1.1.0 while 1.1.0 was already on PyPI, so the
stamper returned 1.1.0-a.0 on every run, and the wheels from the first run made
every later run collide.

This adds an alpha checkbox to the same workflow, off by default. With it
checked, the bumped version gets an -alpha suffix and CITATION.cff is left
alone, since an alpha is not a release and the last one stays the citable
artifact. Unchecked, the workflow behaves exactly as before.

The suffix is what carries a .pre segment for get_prelease_version to
increment, so successive pre-releases stamp a0, a1, a2 rather than a0 forever.
Because the bump is computed from the latest release, the result always sits
above it, and a pre-release built from it cannot collide with a version already
live on PyPI.

The suffix logic lives behind a --alpha flag on bin/bump_version.py. It
appends to Version(...).base_version, which drops any suffix already present
rather than producing 1.2.0-alpha-alpha.

Verified locally

Replayed the workflow's shell block against the real scripts, for every input
combination:

alpha=false patch  -> 1.1.1          changed: pyproject.toml CITATION.cff
alpha=false minor  -> 1.2.0          changed: pyproject.toml CITATION.cff
alpha=false major  -> 2.0.0          changed: pyproject.toml CITATION.cff
alpha=true  patch  -> 1.1.1-alpha    changed: pyproject.toml
alpha=true  minor  -> 1.2.0-alpha    changed: pyproject.toml
alpha=true  major  -> 2.0.0-alpha    changed: pyproject.toml

CITATION.cff with alpha=true : version: 1.1.0 (untouched)
CITATION.cff with alpha=false: version: 1.2.0

running --alpha twice writes 1.2.0-alpha both times
1.2.0-alpha parses as PEP 440 1.2.0a0
pre-release run 1 -> 1.2.0-a.0, run 2 -> 1.2.0-a.1

Note

Dispatching with the same inputs twice produces no diff, so the commit step fails
with "nothing to commit". That behaviour is unchanged by this PR.

@argus-eye

argus-eye Bot commented Aug 25, 2026

Copy link
Copy Markdown

Argus review

Auto-review is off for this repo. Tick the box below to run a review on this PR.

  • Trigger Argus review

Estimated cost

  • Files changed: 3
  • Diff lines (±): 90
  • Historical avg: ~243.6k tokens · ~$0.95 · across last 10 review(s)

Tip: you can also comment @argus-eye review at any time.

@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 4961c06d-97ed-48f6-a9f2-8f56b7811443

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Opens a development cycle. With alpha checked the bumped version gets an -alpha
suffix and CITATION.cff is left alone, since an alpha is not a release. Without
it the workflow behaves exactly as before.

The suffix is what lets successive pre-releases stamp a0, a1, a2. A plain version
equal to a released one makes the stamper return a0 forever, which is how 1.1.0a0
came to collide with itself.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@TheGupta2012
TheGupta2012 force-pushed the ci/stamp-alpha-version branch from 0858fca to aaeb130 Compare August 25, 2026 07:42
@TheGupta2012 TheGupta2012 changed the title ci: add a Stamp Alpha Version workflow ci: add an alpha input to the Bump Version workflow Aug 25, 2026
@TheGupta2012
TheGupta2012 requested a review from ryanhill1 August 25, 2026 07:50
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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