From d01f960e4f565325d13446f16a245be2d6609a53 Mon Sep 17 00:00:00 2001 From: Sebastian Mohr Date: Mon, 13 Oct 2025 17:10:38 +0200 Subject: [PATCH 1/6] Fixed an issue where the poetry-dynamic-versioning-plugin was not used in release artifacts. Also adds a test_release workflow which allows to create the release distribution. --- .github/workflows/test_release.yaml | 43 +++++++++++++++++++++++++++++ extra/release.py | 4 --- pyproject.toml | 5 ++-- 3 files changed, 46 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/test_release.yaml diff --git a/.github/workflows/test_release.yaml b/.github/workflows/test_release.yaml new file mode 100644 index 000000000..fd1c79c03 --- /dev/null +++ b/.github/workflows/test_release.yaml @@ -0,0 +1,43 @@ +name: Make a Beets Release artifacts + +on: + workflow_dispatch: + inputs: + version: + description: 'Version of the new release, just as a number with no prepended "v"' + required: true + +env: + PYTHON_VERSION: 3.9 + NEW_VERSION: ${{ inputs.version }} + NEW_TAG: v${{ inputs.version }} + +jobs: + increment-version: + name: Bump version, commit and create tag + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Install Python tools + uses: BrandonLWhite/pipx-install-action@v1.0.3 + - uses: actions/setup-python@v5 + with: + python-version: ${{ env.PYTHON_VERSION }} + cache: poetry + + - name: Install dependencies + run: poetry install --with=release --extras=docs + + - name: Bump project version + run: poe bump "${{ env.NEW_VERSION }}" + + - name: Build a binary wheel and a source tarball + run: poe build + + - name: Store the distribution packages + uses: actions/upload-artifact@v4 + with: + name: python-package-distributions-test + path: dist/ diff --git a/extra/release.py b/extra/release.py index b47de8966..650c2c40b 100755 --- a/extra/release.py +++ b/extra/release.py @@ -170,10 +170,6 @@ Other changes: UpdateVersionCallable = Callable[[str, Version], str] FILENAME_AND_UPDATE_TEXT: list[tuple[Path, UpdateVersionCallable]] = [ - ( - PYPROJECT, - lambda text, new: re.sub(r"(?<=\nversion = )[^\n]+", f'"{new}"', text), - ), (CHANGELOG, update_changelog), (BASE / "docs" / "conf.py", update_docs_config), ] diff --git a/pyproject.toml b/pyproject.toml index 3a355418c..b21d0d17a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "beets" -version = "2.5.0" +version = "0.0.0" description = "music tagger and library organizer" authors = ["Adrian Sampson "] maintainers = ["Serene-Arc"] @@ -36,6 +36,7 @@ include = [ # extra files to include in the sdist ] exclude = ["docs/_build", "docs/modd.conf", "docs/**/*.css"] + [tool.poetry.urls] Changelog = "https://github.com/beetbox/beets/blob/master/docs/changelog.rst" "Bug Tracker" = "https://github.com/beetbox/beets/issues" @@ -173,7 +174,7 @@ build-backend = "poetry_dynamic_versioning.backend" [tool.pipx-install] poethepoet = ">=0.26" -poetry = ">=1.8,<2" +poetry = { version = ">=1.8,<2", inject = {"poetry-dynamic-versioning[plugin]" = ">=1.9.1" }} [tool.poe.tasks.build] help = "Build the package" From 4ea37b4579f245f5d1d591615f7a91656442764c Mon Sep 17 00:00:00 2001 From: Sebastian Mohr Date: Mon, 13 Oct 2025 17:18:00 +0200 Subject: [PATCH 2/6] Added changelog entry fixed action to use sha. --- .github/workflows/test_release.yaml | 4 ++-- docs/changelog.rst | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_release.yaml b/.github/workflows/test_release.yaml index fd1c79c03..af960021d 100644 --- a/.github/workflows/test_release.yaml +++ b/.github/workflows/test_release.yaml @@ -1,4 +1,4 @@ -name: Make a Beets Release artifacts +name: Create a beets release artifact (testing only) on: workflow_dispatch: @@ -21,7 +21,7 @@ jobs: with: fetch-depth: 0 - name: Install Python tools - uses: BrandonLWhite/pipx-install-action@v1.0.3 + uses: BrandonLWhite/pipx-install-action@1b697df89b675eb31d19417e53b4c066d21650d7 # v1.1.0 - uses: actions/setup-python@v5 with: python-version: ${{ env.PYTHON_VERSION }} diff --git a/docs/changelog.rst b/docs/changelog.rst index 773c6cc67..5f4afe58d 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -17,6 +17,9 @@ Bug fixes: For packagers: +- Fixed dynamic versioning install not disabled for source distribution builds. + :bug:`6089` + Other changes: - Removed outdated mailing list contact information from the documentation From ac31bee4ca6fd8e3f1da0981772a6038e6b1130d Mon Sep 17 00:00:00 2001 From: Sebastian Mohr Date: Tue, 14 Oct 2025 10:21:47 +0200 Subject: [PATCH 3/6] Reverted placeholder. --- extra/release.py | 4 ++++ pyproject.toml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/extra/release.py b/extra/release.py index 650c2c40b..b47de8966 100755 --- a/extra/release.py +++ b/extra/release.py @@ -170,6 +170,10 @@ Other changes: UpdateVersionCallable = Callable[[str, Version], str] FILENAME_AND_UPDATE_TEXT: list[tuple[Path, UpdateVersionCallable]] = [ + ( + PYPROJECT, + lambda text, new: re.sub(r"(?<=\nversion = )[^\n]+", f'"{new}"', text), + ), (CHANGELOG, update_changelog), (BASE / "docs" / "conf.py", update_docs_config), ] diff --git a/pyproject.toml b/pyproject.toml index b21d0d17a..b6c846a54 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "beets" -version = "0.0.0" +version = "2.5.0" description = "music tagger and library organizer" authors = ["Adrian Sampson "] maintainers = ["Serene-Arc"] From 7f15a4608137ccb5ad7e0fcfe25210454736def8 Mon Sep 17 00:00:00 2001 From: Sebastian Mohr Date: Tue, 14 Oct 2025 10:34:08 +0200 Subject: [PATCH 4/6] Added perms to flow. --- .github/workflows/test_release.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test_release.yaml b/.github/workflows/test_release.yaml index af960021d..9efde5e64 100644 --- a/.github/workflows/test_release.yaml +++ b/.github/workflows/test_release.yaml @@ -1,4 +1,6 @@ name: Create a beets release artifact (testing only) +permissions: + contents: write on: workflow_dispatch: From febb1d2e08c819c03fb914e713fb7ff8155e1eb2 Mon Sep 17 00:00:00 2001 From: Sebastian Mohr Date: Tue, 14 Oct 2025 11:43:27 +0200 Subject: [PATCH 5/6] Removed test release file. --- .github/workflows/test_release.yaml | 45 ----------------------------- 1 file changed, 45 deletions(-) delete mode 100644 .github/workflows/test_release.yaml diff --git a/.github/workflows/test_release.yaml b/.github/workflows/test_release.yaml deleted file mode 100644 index 9efde5e64..000000000 --- a/.github/workflows/test_release.yaml +++ /dev/null @@ -1,45 +0,0 @@ -name: Create a beets release artifact (testing only) -permissions: - contents: write - -on: - workflow_dispatch: - inputs: - version: - description: 'Version of the new release, just as a number with no prepended "v"' - required: true - -env: - PYTHON_VERSION: 3.9 - NEW_VERSION: ${{ inputs.version }} - NEW_TAG: v${{ inputs.version }} - -jobs: - increment-version: - name: Bump version, commit and create tag - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Install Python tools - uses: BrandonLWhite/pipx-install-action@1b697df89b675eb31d19417e53b4c066d21650d7 # v1.1.0 - - uses: actions/setup-python@v5 - with: - python-version: ${{ env.PYTHON_VERSION }} - cache: poetry - - - name: Install dependencies - run: poetry install --with=release --extras=docs - - - name: Bump project version - run: poe bump "${{ env.NEW_VERSION }}" - - - name: Build a binary wheel and a source tarball - run: poe build - - - name: Store the distribution packages - uses: actions/upload-artifact@v4 - with: - name: python-package-distributions-test - path: dist/ From 31488e79dae45edd67467512d7b1a4935000c0ca Mon Sep 17 00:00:00 2001 From: Sebastian Mohr Date: Tue, 14 Oct 2025 12:47:27 +0200 Subject: [PATCH 6/6] Removed additional linebreaks. --- pyproject.toml | 2 -- 1 file changed, 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index b6c846a54..dd67fa65c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,7 +36,6 @@ include = [ # extra files to include in the sdist ] exclude = ["docs/_build", "docs/modd.conf", "docs/**/*.css"] - [tool.poetry.urls] Changelog = "https://github.com/beetbox/beets/blob/master/docs/changelog.rst" "Bug Tracker" = "https://github.com/beetbox/beets/issues" @@ -159,7 +158,6 @@ web = ["flask", "flask-cors"] [tool.poetry.scripts] beet = "beets.ui:main" - [tool.poetry-dynamic-versioning] enable = true vcs = "git"