Skip to content

Update versioning scheme#99

Merged
teutoburg merged 4 commits into
mainfrom
teutoburg-patch-1
Jul 22, 2026
Merged

Update versioning scheme#99
teutoburg merged 4 commits into
mainfrom
teutoburg-patch-1

Conversation

@teutoburg

@teutoburg teutoburg commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

TLDR

We've been using prerelease version numbers (a0 etc.) in place of dev version numbers for the last 3 yr. This PR fixes that and also introduces an updated release workflow.

Why?

Our use of prerelease numbers was not only conceptually questionable, but confuses e.g. pooch (rightfully so, nothing wrong with that package, everything wrong with our version numbers).

What??

See the markdown doc added as part of this PR, which also serves as general documentation on our version numbering going forward. Hence in a separate doc and not the PR body.

Updated version bump workflow to include 'dev' option and handle dev versioning logic.
@teutoburg teutoburg self-assigned this Jul 20, 2026
@teutoburg teutoburg added enhancement New feature or request github_actions Pull requests that update GitHub Actions code labels Jul 20, 2026
@codecov

codecov Bot commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (3aa3f22) to head (04758ea).

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #99   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            2         2           
  Lines            7         7           
=========================================
  Hits             7         7           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Added a verification step to ensure the release tag matches the package version before publishing to PyPI.
This was created by Claude Fable 5 to provide a reference for the
version scheme changes.
This workflow automates the process of preparing a release by bumping the package version, creating a draft GitHub release, and then bumping the version to the next development version.
@teutoburg
teutoburg marked this pull request as ready for review July 21, 2026 19:28
@teutoburg
teutoburg requested a review from hugobuddel July 21, 2026 19:28

## 9. Situation: backport to a released series
Only needed once a breaking change has landed on `main` (otherwise: just release `main` as the next minor).
Fixes land on `main` **first**, then get cherry-picked out — never developed only on the maintenance branch.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You could also create the branch for the fix from an earlier commit (e.g. the commit that broke something), then you might be able to merge the fix into both main and the release branch directly (without having to cherry-pick).

`git branch v2.x v2.1.0 && git push origin v2.x` (branching from a later `main` commit would smuggle unreleased feature work into a "critical patch")
- [ ] Verify CI workflow triggers cover the branch (add `"v*.x"` to the `branches:` lists if not already glob-covered)
- [ ] Repoint data-download fallbacks from `main` to `v2.x` (e.g. the pooch fallback-branch constant), so source installs from the branch fetch series-matching data
- [ ] Note the support window for the old series in README/docs

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm struggling a bit with the 'verbosity' of the document. Such a check-list is perhaps a good way to make it more concrete, but this is the only one in the document.

Maybe you could organize the document around the different 'situations', and what to do in those situations with a checklist. That is, have a checklist also for the other situations.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The verbosity here is easily explained by the fact that I didn't write this myself. I should have disclosed the use of AI as I usually do in the PR description. I'm all in favor of rewriting it 👍

@hugobuddel hugobuddel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I like it!

Playing the devils advocate a bit / taking this one step further: can we just ditch the entire version in the code and rely only on the git tag? That is, the 'current version' only exists as a git tag, and the version of the installed package is derived from the git checkout. So the version is either a tag or a commit hash. That would do away with all the dev versions (or well, implicit ones, people could still tag them). I feel that that is where most projects are going nowadays.

You'd need to refer to the git history to figure out exactly what version is what, but that is perhaps not such a hassle I think.

You'd need to do something smart with the Changelog though, to get the correct version numbers in there. But I think that is manageable.

When no rule does what you need, an explicit version is always a legitimate escape hatch.

## 2. Poetry rule matrix (empirical, Poetry 2.3.0)
What `poetry version <rule>` produces from each phase our scheme visits:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This matrix is perhaps a detail that could be more useful at the end of the document. The result is more important than the path (well, not really, but it is good to start with the result).

- Version numbers change **only on `main`** (or a maintenance branch, §9), and in the normal case **only via CI** (bot commits).
Never bump versions on feature branches — this is what makes overlapping branches conflict-free.
- The repo is **always on a `.devN` version** between tags.
Every tag is immediately followed by a dev-bump commit; the tagged version string never lingers.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yeah that's nice, have the tagged version never linger.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We technically already had that feature automated, it always bumped to the next prerelease after publishing a tagged version. But now with dev versions instead.

@teutoburg

Copy link
Copy Markdown
Contributor Author

Playing the devils advocate a bit / taking this one step further: can we just ditch the entire version in the code and rely only on the git tag? That is, the 'current version' only exists as a git tag, and the version of the installed package is derived from the git checkout. So the version is either a tag or a commit hash. That would do away with all the dev versions (or well, implicit ones, people could still tag them). I feel that that is where most projects are going nowadays.

I think what you're describing is often called a "dynamic version [number]" elsewhere. My main issue with it is that I like having a version number written down somewhere (i.e. in the toml file). But I can also see benefits of a dynamic version, so maybe that's just my own inertia. Nevertheless, I think we can keep the version number in the toml for now. We introduced the prerelease scheme some 3 yr ago and only now had an actual need to change things (slightly). So maybe in another 3 yr we might move to dynamic versions, who knows 🙂

Either way, you approved it, so I assume it's "good enough" for now.

@teutoburg
teutoburg merged commit bdca7e3 into main Jul 22, 2026
22 checks passed
@teutoburg
teutoburg deleted the teutoburg-patch-1 branch July 22, 2026 11:12
@hugobuddel

Copy link
Copy Markdown
Contributor

Yeah I understand that feeling. So this is good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request github_actions Pull requests that update GitHub Actions code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants