Skip to content

Commit 5513859

Browse files
chore(release): replace bump2version with bump-my-version
Made-with: Cursor
1 parent 72dcdab commit 5513859

13 files changed

Lines changed: 73 additions & 70 deletions

.bumpversion.cfg

Lines changed: 0 additions & 26 deletions
This file was deleted.

.cursor/rules/changelog-best-practices.mdc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ Documentation changes should be grouped under the **Documentation** category, no
139139

140140
## Release Process
141141

142-
Follow **CONTRIBUTING.md §7 (Releasing for maintainers)** (Git Flow: `release/*` branch). Maintainers **must run** **`python3 scripts/prepare_release_bump.py`** `patch`|`minor`|`major` before creating/pushing a `release/*` branch. The script applies the `## [Unreleased] <!-- release -->` marker (see `.bumpversion.cfg`), runs **bump2version**, **`scripts/fix_changelog_after_bump.py`**, and inserts an empty `## [Unreleased]` for the next cycle. Contributors use plain `## [Unreleased]` until the maintainer runs the script.
142+
Follow **CONTRIBUTING.md §7 (Releasing for maintainers)** (Git Flow: `release/*` branch). Maintainers **must run** **`python3 scripts/prepare_release_bump.py`** `patch`|`minor`|`major` before creating/pushing a `release/*` branch. The script applies the `## [Unreleased] <!-- release -->` marker (see `[tool.bumpversion]` in `pyproject.toml`), runs **bump-my-version**, **`scripts/fix_changelog_after_bump.py`**, and inserts an empty `## [Unreleased]` for the next cycle. Contributors use plain `## [Unreleased]` until the maintainer runs the script.
143143

144144
During releases, maintainers also:
145145
1. Review and consolidate entries moved under the new version

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
# =============================================================================
44
*.pyc
55
.venv/
6-
.venv-release/
76
venv/
87
.mypy_cache/
98
.ruff_cache/

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ All contributors (including maintainers) should update `CHANGELOG.md` when creat
7676

7777
- **Linting (audiometa-python baseline)**: [`.pre-commit-config.yaml`](.pre-commit-config.yaml) matches the audiometa-python hook stack (tool version check, YAML/JSON/TOML, shellcheck, `no-assert`, ruff-format, ruff, mypy + django-stubs, pydocstringformatter, long-comment fixer, Prettier, optional PSScriptAnalyzer) plus **`prefer-strenum`** (pre-commit no longer runs **isort**; org **v4.3+** verifier forbids it alongside **ruff format**). Configuration lives in [`pyproject.toml`](pyproject.toml); linter and test dependencies are pinned under `[project.optional-dependencies] dev`. Ruff **select** matches audiometa; extra **ignores** document Django/DRF cleanup debt. Mypy is plugin-aligned but **gradual** (`ignore_missing_imports`, non-strict) until typing can match audiometa strictness.
7878

79-
- **Packaging (PEP 621, audiometa-style)**: Runtime and dev dependencies are declared in `pyproject.toml` (`[project]` / `[project.optional-dependencies] dev`) with setuptools as the build backend. Local and CI use `pip install -e ".[dev]"`; production Docker builds use `pip install .`. There is no `requirements.txt`; `pyproject.toml` is the only dependency manifest. Release bumps now update `pyproject.toml` `[project] version` via bump2version. `fake-samples-loader` is pinned to `1.0.13`; `django-dynamic-fixture` is a dev extra (tests only).
79+
- **Packaging (PEP 621, audiometa-style)**: Runtime and dev dependencies are declared in `pyproject.toml` (`[project]` / `[project.optional-dependencies] dev`) with setuptools as the build backend. Local and CI use `pip install -e ".[dev]"`; production Docker builds use `pip install .`. There is no `requirements.txt`; `pyproject.toml` is the only dependency manifest. Release bumps update `pyproject.toml` `[project] version` via **bump-my-version** (`[tool.bumpversion]`). `fake-samples-loader` is pinned to `1.0.13`; `django-dynamic-fixture` is a dev extra (tests only).
8080

8181
- **[`.pre-commit-hooks/`](.pre-commit-hooks/)**: Shell wrappers copied from audiometa-python (`tool-wrapper`, `check-tool-versions`, shellcheck, `no-assert`, etc.).
8282

@@ -116,7 +116,7 @@ All contributors (including maintainers) should update `CHANGELOG.md` when creat
116116

117117
- **Library path env contract**: Removed runtime usage of `LIBRARIES_DIR_NAME`; settings and user library path generation now rely on `LIBRARIES_DIR` only. Updated Compose defaults, test workflow env, and dev env example accordingly.
118118

119-
- **Release tooling**: [`scripts/prepare_release_bump.py`](scripts/prepare_release_bump.py) no longer requires an activated project virtualenv; maintainers only need `bump2version` on `PATH` (same pin as dev deps). [CONTRIBUTING.md](CONTRIBUTING.md) §7 documents `pipx`, dev installs, or Compose `api` as options. [`.gitignore`](.gitignore) adds `.venv-release/` for optional local one-off venvs.
119+
- **Release tooling**: Replaced deprecated **bump2version** with **[bump-my-version](https://github.com/callowayproject/bump-my-version)** (`bump-my-version==1.3.0`); bump rules live under `[tool.bumpversion]` in [`pyproject.toml`](pyproject.toml) (`.bumpversion.cfg` removed). [`scripts/prepare_release_bump.py`](scripts/prepare_release_bump.py) runs `bump-my-version bump patch|minor|major`; maintainers only need the CLI on `PATH` (pipx, pyenv-backed install, or Compose `api` with dev extras). [CONTRIBUTING.md](CONTRIBUTING.md) §7 updated accordingly. Runtime **Click** is bumped from `7.0` to `8.3.3` (`click<8.4` required by bump-my-version) so dev installs can run the bump CLI in the same environment.
120120

121121
### CI
122122

CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -832,15 +832,15 @@ Quick release process:
832832

833833
3. **On the release branch, prepare the release:**
834834

835-
- **Automated (recommended):** from the repo root, with `bump2version` on `PATH` (same pin as dev deps in [`pyproject.toml`](pyproject.toml), currently `bump2version==1.0.1` — e.g. `pipx install bump2version==1.0.1`, or run bump steps inside the Compose `api` dev image where dev extras are installed). No project `.venv` is required.
835+
- **Automated (recommended):** from the repo root, with `bump-my-version` on `PATH` (same pin as dev deps in [`pyproject.toml`](pyproject.toml), currently `bump-my-version==1.3.0` — e.g. `pipx install bump-my-version==1.3.0`, a pyenv (or other) Python where `pip install -e ".[dev]"` is allowed, or run bump steps inside the Compose `api` dev image where dev extras are installed). No project `.venv` is required.
836836

837837
```bash
838838
python3 scripts/prepare_release_bump.py patch # or: minor | major
839839
```
840840

841-
This sets the live `## [Unreleased] <!-- release -->` marker (only the heading **after** the maintainer Note—not the fenced example), runs [bump2version](https://github.com/c4urself/bump2version), runs `python scripts/fix_changelog_after_bump.py`, and adds an empty `## [Unreleased]` above the new version section. By default it passes `--allow-dirty` to bump2version so you can commit once at the end; use `--no-allow-dirty` if you need a clean tree.
841+
This sets the live `## [Unreleased] <!-- release -->` marker (only the heading **after** the maintainer Note—not the fenced example), runs [bump-my-version](https://github.com/callowayproject/bump-my-version), runs `python scripts/fix_changelog_after_bump.py`, and adds an empty `## [Unreleased]` above the new version section. By default it passes `--allow-dirty` so you can commit once at the end; use `--no-allow-dirty` if you need a clean tree.
842842

843-
- **Manual sequence** (same end state): set the live heading after the Note to `## [Unreleased] <!-- release -->`, then `bump2version patch` (or minor/major; add `--allow-dirty` if needed), then `python scripts/fix_changelog_after_bump.py`, then ensure an empty `## [Unreleased]` sits above `## [vX.Y.Z] - …`. `.bumpversion.cfg` only replaces that one changelog line; everything below it until the next `## [` belongs to that release.
843+
- **Manual sequence** (same end state): set the live heading after the Note to `## [Unreleased] <!-- release -->`, then `bump-my-version bump patch` (or `bump minor` / `bump major`; add `--allow-dirty` if needed), then `python scripts/fix_changelog_after_bump.py`, then ensure an empty `## [Unreleased]` sits above `## [vX.Y.Z] - …`. Release bump file rules live under `[tool.bumpversion]` in [`pyproject.toml`](pyproject.toml); the changelog rule only replaces that one heading line everything below it until the next `## [` belongs to that release.
844844

845845
- Review and finalize `CHANGELOG.md`:
846846

@@ -876,7 +876,7 @@ Quick release process:
876876
./scripts/remove_prerelease_tags.sh
877877
```
878878

879-
The script uses the version from the `VERSION` file (same as after `bump2version`). You can also pass a version explicitly: `./scripts/remove_prerelease_tags.sh 0.2.1`.
879+
The script uses the version from the `VERSION` file (same as after a release bump). You can also pass a version explicitly: `./scripts/remove_prerelease_tags.sh 0.2.1`.
880880

881881
**Note:** Pre-release tags are temporary and should be cleaned up after the release is published to keep the repository clean.
882882

docs/versioning.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ The workflow extracts the version from the ref, uses it for the Docker image tag
155155

156156
### Creating a Release
157157

158-
**Source of truth:** full Git Flow (release branch, `python3 scripts/prepare_release_bump.py` or `bump2version` by hand, `CHANGELOG.md`, PR to `main`, tag with `v` prefix, merge back to `develop`, delete release branch) is documented in [CONTRIBUTING.md](../CONTRIBUTING.md#7-releasing-for-maintainers) §7. The steps below are a short tag/publish reminder only.
158+
**Source of truth:** full Git Flow (release branch, `python3 scripts/prepare_release_bump.py` or `bump-my-version bump …` by hand, `CHANGELOG.md`, PR to `main`, tag with `v` prefix, merge back to `develop`, delete release branch) is documented in [CONTRIBUTING.md](../CONTRIBUTING.md#7-releasing-for-maintainers) §7. The steps below are a short tag/publish reminder only.
159159

160160
```bash
161161
# After VERSION and CHANGELOG on main match the release (see CONTRIBUTING.md §7):

hear_the_music_tree_api.egg-info/PKG-INFO

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Requires-Dist: bcrypt==3.1.7
1010
Requires-Dist: blinker==1.4
1111
Requires-Dist: certifi==2019.11.28
1212
Requires-Dist: chardet==3.0.4
13-
Requires-Dist: Click==7.0
13+
Requires-Dist: Click==8.3.3
1414
Requires-Dist: colorama==0.4.3
1515
Requires-Dist: Django==5.2.8
1616
Requires-Dist: django-cors-headers==4.3.1
@@ -42,14 +42,15 @@ Requires-Dist: python-dateutil==2.7.3
4242
Requires-Dist: python-dotenv==1.0.1
4343
Requires-Dist: python-magic==0.4.27
4444
Requires-Dist: requests==2.32.3
45+
Requires-Dist: setuptools==75.2.0
4546
Requires-Dist: shortuuid==1.0.9
4647
Requires-Dist: simplejson==3.16.0
4748
Requires-Dist: spotipy==2.23.0
4849
Requires-Dist: tinytag==1.10.1
4950
Requires-Dist: uvicorn==0.20.0
5051
Requires-Dist: werkzeug==2.2.2
5152
Provides-Extra: dev
52-
Requires-Dist: bump2version==1.0.1; extra == "dev"
53+
Requires-Dist: bump-my-version==1.3.0; extra == "dev"
5354
Requires-Dist: coverage==6.5.0; extra == "dev"
5455
Requires-Dist: django-dynamic-fixture==4.0.1; extra == "dev"
5556
Requires-Dist: django-stubs==5.2.1; extra == "dev"

hear_the_music_tree_api.egg-info/SOURCES.txt

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,6 @@ api/serializer/audio_metadata/AudioMetadataRequestFile.py
224224
api/serializer/audio_metadata/AudioMetadataRequestUrl.py
225225
api/serializer/audio_metadata/AudioMetadataSessionDownload.py
226226
api/serializer/audio_metadata/Fields.py
227-
api/serializer/audio_metadata/WritableMetadataFieldsMixin.py
228227
api/serializer/field/AppBooleanField.py
229228
api/serializer/field/AppCharField.py
230229
api/serializer/field/AppDictField.py
@@ -406,7 +405,6 @@ api/test/tests/integration/artist/list/filter/test_not_existing.py
406405
api/test/tests/integration/artist/retrieve/__init__.py
407406
api/test/tests/integration/artist/retrieve/test_lib_tracks.py
408407
api/test/tests/integration/audio_metadata/AudioMetadataTestCase.py
409-
api/test/tests/integration/audio_metadata/__init__.py
410408
api/test/tests/integration/audio_metadata/test_full.py
411409
api/test/tests/integration/audio_metadata/test_metadata_session.py
412410
api/test/tests/integration/audio_metadata/test_musicbrainz_analysis.py
@@ -746,11 +744,11 @@ api/test/tests/integration/uploaded_track/input/save/test_extra_field.py
746744
api/test/tests/integration/uploaded_track/input/save/test_language.py
747745
api/test/tests/integration/uploaded_track/input/save/test_rating.py
748746
api/test/tests/integration/uploaded_track/input/save/test_title.py
749-
api/test/tests/integration/uploaded_track/input/save/album attributes/__init__.py
750-
api/test/tests/integration/uploaded_track/input/save/album attributes/test_album.py
751-
api/test/tests/integration/uploaded_track/input/save/album attributes/test_album_and_album_artists.py
752-
api/test/tests/integration/uploaded_track/input/save/album attributes/test_album_artists.py
753-
api/test/tests/integration/uploaded_track/input/save/album attributes/test_track_number.py
747+
api/test/tests/integration/uploaded_track/input/save/album_attributes/__init__.py
748+
api/test/tests/integration/uploaded_track/input/save/album_attributes/test_album.py
749+
api/test/tests/integration/uploaded_track/input/save/album_attributes/test_album_and_album_artists.py
750+
api/test/tests/integration/uploaded_track/input/save/album_attributes/test_album_artists.py
751+
api/test/tests/integration/uploaded_track/input/save/album_attributes/test_track_number.py
754752
api/test/tests/integration/uploaded_track/input/save/genre/__init__.py
755753
api/test/tests/integration/uploaded_track/input/save/genre/test_genre_name.py
756754
api/test/tests/integration/uploaded_track/input/save/genre/test_genre_uuid.py
@@ -832,14 +830,12 @@ api/test/tests/unit/serializer/test_model_serializer_inheritance.py
832830
api/test/tests/unit/serializer/field/__init__.py
833831
api/test/tests/unit/serializer/field/test_app_boolean_field.py
834832
api/test/tests/unit/serializer/field/test_field_inheritance.py
835-
api/test/tests/unit/utils/audio_file_metadata/test_metadata_session_app_metadata.py
836833
api/test/tests/unit/utils/audio_fingerprinter/test_analysis.py
837834
api/test/tests/unit/utils/audiometa_adapter/__init__.py
838835
api/test/tests/unit/utils/audiometa_adapter/test_audiometa_adapter.py
839836
api/test/tests/unit/utils/decorators/test_spotify_user_required_decorator.py
840837
api/test/tests/unit/utils/file_path_utils/__init__.py
841838
api/test/tests/unit/utils/file_path_utils/test_file_path_utils.py
842-
api/test/tests/unit/utils/metadata_session/test_service.py
843839
api/test/tests/unit/utils/musicbrainz/__init__.py
844840
api/test/tests/unit/utils/musicbrainz/test_create_or_update.py
845841
api/test/tests/unit/utils/musicbrainz/test_recording_analysis.py

hear_the_music_tree_api.egg-info/requires.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ bcrypt==3.1.7
44
blinker==1.4
55
certifi==2019.11.28
66
chardet==3.0.4
7-
Click==7.0
7+
Click==8.3.3
88
colorama==0.4.3
99
Django==5.2.8
1010
django-cors-headers==4.3.1
@@ -45,7 +45,7 @@ uvicorn==0.20.0
4545
werkzeug==2.2.2
4646

4747
[dev]
48-
bump2version==1.0.1
48+
bump-my-version==1.3.0
4949
coverage==6.5.0
5050
django-dynamic-fixture==4.0.1
5151
django-stubs==5.2.1

pyproject.toml

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ dependencies = [
1717
"blinker==1.4",
1818
"certifi==2019.11.28",
1919
"chardet==3.0.4",
20-
"Click==7.0",
20+
"Click==8.3.3",
2121
"colorama==0.4.3",
2222
"Django==5.2.8",
2323
"django-cors-headers==4.3.1",
@@ -60,7 +60,7 @@ dependencies = [
6060

6161
[project.optional-dependencies]
6262
dev = [
63-
"bump2version==1.0.1",
63+
"bump-my-version==1.3.0",
6464
"coverage==6.5.0",
6565
"django-dynamic-fixture==4.0.1",
6666
"django-stubs==5.2.1",
@@ -139,3 +139,35 @@ ignore_errors = true
139139
[[tool.mypy.overrides]]
140140
module = "pytest"
141141
ignore_missing_imports = true
142+
143+
# Release bumps (maintainers): `bump-my-version bump patch|minor|major` or `scripts/prepare_release_bump.py`.
144+
# https://github.com/callowayproject/bump-my-version
145+
[tool.bumpversion]
146+
current_version = "2.2.3"
147+
commit = false
148+
tag = false
149+
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
150+
serialize = ["{major}.{minor}.{patch}"]
151+
152+
[[tool.bumpversion.files]]
153+
filename = "VERSION"
154+
155+
[[tool.bumpversion.files]]
156+
filename = "package.json"
157+
search = "\"version\": \"{current_version}\""
158+
replace = "\"version\": \"{new_version}\""
159+
160+
[[tool.bumpversion.files]]
161+
filename = "schema.yml"
162+
search = "version: {current_version}"
163+
replace = "version: {new_version}"
164+
165+
[[tool.bumpversion.files]]
166+
filename = "CHANGELOG.md"
167+
search = "## [Unreleased] <!-- release -->"
168+
replace = "## [v{new_version}] - YYYY-MM-DD"
169+
170+
[[tool.bumpversion.files]]
171+
filename = "pyproject.toml"
172+
search = "version = \"{current_version}\""
173+
replace = "version = \"{new_version}\""

0 commit comments

Comments
 (0)