mirror of
https://github.com/beetbox/beets.git
synced 2025-12-06 08:39:17 +01:00
Add git commit suffix to __version__ for development installs (#5967)
Make it obvious when beets is installed from from a non major version. When installed locally this adds a git hash suffix and the distance to the last release. closes #4448
This commit is contained in:
parent
4782e96599
commit
f6ca68319d
6 changed files with 28 additions and 9 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -94,3 +94,6 @@ ENV/
|
||||||
|
|
||||||
# pyright
|
# pyright
|
||||||
pyrightconfig.json
|
pyrightconfig.json
|
||||||
|
|
||||||
|
# Versioning
|
||||||
|
beets/_version.py
|
||||||
|
|
|
||||||
|
|
@ -17,9 +17,10 @@ from sys import stderr
|
||||||
|
|
||||||
import confuse
|
import confuse
|
||||||
|
|
||||||
|
# Version management using poetry-dynamic-versioning
|
||||||
|
from ._version import __version__, __version_tuple__
|
||||||
from .util import deprecate_imports
|
from .util import deprecate_imports
|
||||||
|
|
||||||
__version__ = "2.4.0"
|
|
||||||
__author__ = "Adrian Sampson <adrian@radbox.org>"
|
__author__ = "Adrian Sampson <adrian@radbox.org>"
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -54,3 +55,6 @@ class IncludeLazyConfig(confuse.LazyConfig):
|
||||||
|
|
||||||
|
|
||||||
config = IncludeLazyConfig("beets", __name__)
|
config = IncludeLazyConfig("beets", __name__)
|
||||||
|
|
||||||
|
|
||||||
|
__all__ = ["__version__", "__version_tuple__", "config"]
|
||||||
|
|
|
||||||
7
beets/_version.py
Normal file
7
beets/_version.py
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
# This file is auto-generated during the build process.
|
||||||
|
# Do not edit this file directly.
|
||||||
|
# Placeholders are replaced during substitution.
|
||||||
|
# Run `git update-index --assume-unchanged beets/_version.py`
|
||||||
|
# to ignore local changes to this file.
|
||||||
|
__version__ = "0.0.0"
|
||||||
|
__version_tuple__ = (0, 0, 0)
|
||||||
|
|
@ -53,6 +53,8 @@ Other changes:
|
||||||
``beetsplug._utils``.
|
``beetsplug._utils``.
|
||||||
- :class:`beets.metadata_plugin.MetadataSourcePlugin`: Remove discogs specific
|
- :class:`beets.metadata_plugin.MetadataSourcePlugin`: Remove discogs specific
|
||||||
disambiguation stripping.
|
disambiguation stripping.
|
||||||
|
- When installing ``beets`` via git or locally the version string now reflects
|
||||||
|
the current git branch and commit hash. :bug:`4448`
|
||||||
|
|
||||||
For developers and plugin authors:
|
For developers and plugin authors:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -174,12 +174,6 @@ FILENAME_AND_UPDATE_TEXT: list[tuple[Path, UpdateVersionCallable]] = [
|
||||||
PYPROJECT,
|
PYPROJECT,
|
||||||
lambda text, new: re.sub(r"(?<=\nversion = )[^\n]+", f'"{new}"', text),
|
lambda text, new: re.sub(r"(?<=\nversion = )[^\n]+", f'"{new}"', text),
|
||||||
),
|
),
|
||||||
(
|
|
||||||
BASE / "beets" / "__init__.py",
|
|
||||||
lambda text, new: re.sub(
|
|
||||||
r"(?<=__version__ = )[^\n]+", f'"{new}"', text
|
|
||||||
),
|
|
||||||
),
|
|
||||||
(CHANGELOG, update_changelog),
|
(CHANGELOG, update_changelog),
|
||||||
(BASE / "docs" / "conf.py", update_docs_config),
|
(BASE / "docs" / "conf.py", update_docs_config),
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -156,9 +156,18 @@ web = ["flask", "flask-cors"]
|
||||||
[tool.poetry.scripts]
|
[tool.poetry.scripts]
|
||||||
beet = "beets.ui:main"
|
beet = "beets.ui:main"
|
||||||
|
|
||||||
|
|
||||||
|
[tool.poetry-dynamic-versioning]
|
||||||
|
enable = true
|
||||||
|
vcs = "git"
|
||||||
|
format = "{base}.dev{distance}+{commit}"
|
||||||
|
|
||||||
|
[tool.poetry-dynamic-versioning.files."beets/_version.py"]
|
||||||
|
persistent-substitution = true
|
||||||
|
|
||||||
[build-system]
|
[build-system]
|
||||||
requires = ["poetry-core>=1.0.0"]
|
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning>=1.0.0,<2.0.0"]
|
||||||
build-backend = "poetry.core.masonry.api"
|
build-backend = "poetry_dynamic_versioning.backend"
|
||||||
|
|
||||||
[tool.pipx-install]
|
[tool.pipx-install]
|
||||||
poethepoet = ">=0.26"
|
poethepoet = ">=0.26"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue