From 61cbc39c4aa18fd2a2f81e55934b51b4ebf8e752 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0ar=C5=ABnas=20Nejus?= Date: Tue, 14 Oct 2025 23:39:27 +0100 Subject: [PATCH] Revert "Add git commit suffix to __version__ for development installs (#5967)" --- .gitignore | 3 --- beets/__init__.py | 6 +----- beets/_version.py | 7 ------- docs/changelog.rst | 3 +++ extra/release.py | 6 ++++++ pyproject.toml | 13 ++----------- 6 files changed, 12 insertions(+), 26 deletions(-) delete mode 100644 beets/_version.py diff --git a/.gitignore b/.gitignore index 102e1c3e4..90ef7387d 100644 --- a/.gitignore +++ b/.gitignore @@ -94,6 +94,3 @@ ENV/ # pyright pyrightconfig.json - -# Versioning -beets/_version.py diff --git a/beets/__init__.py b/beets/__init__.py index 5f4c6657d..bdb19b579 100644 --- a/beets/__init__.py +++ b/beets/__init__.py @@ -17,10 +17,9 @@ from sys import stderr import confuse -# Version management using poetry-dynamic-versioning -from ._version import __version__, __version_tuple__ from .util import deprecate_imports +__version__ = "2.5.0" __author__ = "Adrian Sampson " @@ -55,6 +54,3 @@ class IncludeLazyConfig(confuse.LazyConfig): config = IncludeLazyConfig("beets", __name__) - - -__all__ = ["__version__", "__version_tuple__", "config"] diff --git a/beets/_version.py b/beets/_version.py deleted file mode 100644 index 4dea56035..000000000 --- a/beets/_version.py +++ /dev/null @@ -1,7 +0,0 @@ -# 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) diff --git a/docs/changelog.rst b/docs/changelog.rst index 8f28e8d1c..a76e69bb9 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -22,6 +22,9 @@ For packagers: - Fixed issue with legacy metadata plugins not copying properties from the base class. +- Reverted the following: When installing ``beets`` via git or locally the + version string now reflects the current git branch and commit hash. + :bug:`6089` Other changes: diff --git a/extra/release.py b/extra/release.py index afa762baf..d4ebb950f 100755 --- a/extra/release.py +++ b/extra/release.py @@ -186,6 +186,12 @@ FILENAME_AND_UPDATE_TEXT: list[tuple[Path, UpdateVersionCallable]] = [ PYPROJECT, 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), (BASE / "docs" / "conf.py", update_docs_config), ] diff --git a/pyproject.toml b/pyproject.toml index 3a355418c..2570330c6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -158,18 +158,9 @@ web = ["flask", "flask-cors"] [tool.poetry.scripts] 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] -requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning>=1.0.0,<2.0.0"] -build-backend = "poetry_dynamic_versioning.backend" +requires = ["poetry-core>=1.0.0"] +build-backend = "poetry.core.masonry.api" [tool.pipx-install] poethepoet = ">=0.26"