Skip to content

forward port #9608: handle invalid and dev versions in version parser#9653

Merged
ThomasWaldmann merged 1 commit into
borgbackup:masterfrom
ThomasWaldmann:versioning-master
May 17, 2026
Merged

forward port #9608: handle invalid and dev versions in version parser#9653
ThomasWaldmann merged 1 commit into
borgbackup:masterfrom
ThomasWaldmann:versioning-master

Conversation

@ThomasWaldmann
Copy link
Copy Markdown
Member

Forward port of #9608 to master.

…borgbackup#9014

- `src/borg/__init__.py`: The `setuptools_scm` fallback version `0.1.dev1`
  was incorrectly bypassing the assertion check (as `0` and `1` are valid
  integers), which hid the intended helpful error message when building
  from source without tags. Added an explicit check for the `0.1.dev` prefix.

- `src/borg/version.py`: `parse_version` and `format_version` have been
  updated to correctly understand `setuptools_scm`'s `.dev` or `dev` prefixes.
  These dev releases are now properly encoded in the version tuple as `-9`
  (which logically makes them older than alphas `-4`, betas `-3`, rcs `-2`,
  and final `-1`), and correctly reformatted to `.dev` strings.

(cherry picked from commit 232ccab)
@codecov
Copy link
Copy Markdown

codecov Bot commented May 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.08%. Comparing base (6659bd9) to head (da0a2ff).
⚠️ Report is 16 commits behind head on master.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #9653   +/-   ##
=======================================
  Coverage   83.08%   83.08%           
=======================================
  Files          90       90           
  Lines       15653    15653           
  Branches     2356     2356           
=======================================
  Hits        13006    13006           
  Misses       1887     1887           
  Partials      760      760           

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

@ThomasWaldmann ThomasWaldmann merged commit ecc9ead into borgbackup:master May 17, 2026
20 checks passed
@ThomasWaldmann ThomasWaldmann deleted the versioning-master branch May 17, 2026 20:12
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.

1 participant