mirror of
https://github.com/borgbackup/borg.git
synced 2026-07-15 04:52:03 -04:00
- `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 232ccabfa3)
20 lines
715 B
Python
20 lines
715 B
Python
from packaging.version import parse as parse_version
|
|
|
|
from ._version import version as __version__
|
|
|
|
|
|
__version_tuple__ = parse_version(__version__).release
|
|
|
|
# assert that all semver components are integers
|
|
# this is mainly to show errors when people repackage poorly
|
|
# and setuptools_scm determines a 0.1.dev... version
|
|
assert not __version__.startswith("0.1.dev") and all(isinstance(v, int) for v in __version_tuple__), (
|
|
"""\
|
|
Broken BorgBackup version metadata: %r
|
|
|
|
Version metadata is obtained dynamically during installation via setuptools_scm;
|
|
please ensure your Git repository has the correct tags, or provide the version
|
|
using SETUPTOOLS_SCM_PRETEND_VERSION in your build script.
|
|
"""
|
|
% __version__
|
|
)
|