Skip to content

fix: auto-sync .bumpversion.cfg on version bump - #36

Merged
amitray007 merged 1 commit into
masterfrom
fix/bumpversion-autosync
Jul 30, 2026
Merged

fix: auto-sync .bumpversion.cfg on version bump#36
amitray007 merged 1 commit into
masterfrom
fix/bumpversion-autosync

Conversation

@amitray007

Copy link
Copy Markdown
Owner

Summary

Root-cause fix for the recurring version drift between .bumpversion.cfg and etsy_python/_version.py.

Why it kept drifting: the publish pipeline bumps the version with scripts/bump_version.py, which only ever wrote _version.py — and the "Commit version bump" step staged only _version.py too. .bumpversion.cfg (read by the bump2version tool, which CI doesn't run) was never advanced, so it fell behind on every release and check_version_consistency.py / the pre-commit hook failed on a clean tree.

Fix (two parts, so they stay in sync going forward):

  • bump_version.py — new sync_bumpversion_cfg(), called after write_version(), rewrites the cfg's current_version line in place. Tolerates the file being absent, honours --dry-run. _version.py stays the single source of truth.
  • python-publish.yml — the commit step now also git add .bumpversion.cfg, so the sync lands in git, not just on the runner's disk.

Also corrects the current drift (1.0.191.1.10) and updates CLAUDE.md, which previously documented the drift as an accepted quirk.

⚠️ Needs your review on the workflow change

.github/workflows/ is CODEOWNERS-protected (requires @amitray007). This PR touches python-publish.yml, so it needs your review to merge — that's expected.

Test plan

source venv/bin/activate
pytest tests/test_bump_version.py -q            # 13 passed
pytest -q                                       # full suite green
python scripts/bump_version.py --dry-run --type patch   # shows it would sync cfg, changes nothing
python scripts/check_version_consistency.py     # OK 1.1.10

New tests/test_bump_version.py covers the bump arithmetic and the sync (updates only current_version, tolerates a missing file, raises on a malformed cfg, idempotent, both files end on the same version).

Relationship to #35

Independent of PR #35 (the #34 spec-drift fix); this is build-tooling only, branched separately off master.

🤖 Generated with Claude Code

Root-cause fix for the recurring version drift. The publish pipeline bumps
`_version.py` via scripts/bump_version.py, which only ever wrote that one
file, while the "Commit version bump" step staged only `_version.py` too.
`.bumpversion.cfg` was therefore never advanced by CI, so it fell behind on
every release and check_version_consistency.py (and the pre-commit hook)
failed on a clean tree.

Two-part fix so the two versions stay consistent going forward:
- bump_version.py: add sync_bumpversion_cfg(), called after write_version(),
  which rewrites the cfg's `current_version` line in place (tolerates the
  file being absent; honours --dry-run). _version.py stays the source of truth.
- python-publish.yml: the commit step now also `git add .bumpversion.cfg`, so
  the sync is committed to git, not just left on the runner's disk.

Also corrects the current drift (cfg 1.0.19 -> 1.1.10) and updates CLAUDE.md,
which previously documented the drift as an accepted quirk.

Note: .github/workflows/ is CODEOWNERS-protected, so this PR needs @amitray007
review on the workflow change.

New tests in tests/test_bump_version.py cover the bump arithmetic and the
sync (updates only current_version, tolerates a missing file, raises on a
malformed cfg, idempotent, and leaves both files on the same version).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@amitray007 amitray007 self-assigned this Jul 30, 2026
@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Test Coverage Report

Overall: 100% (1680/1680 statements covered)

Coverage by file
File Statements Missing Coverage
etsy_python/__init__.py 2 0 100%
etsy_python/_version.py 1 0 100%
etsy_python/v3/auth/OAuth.py 33 0 100%
etsy_python/v3/auth/__init__.py 1 0 100%
etsy_python/v3/common/Env.py 10 0 100%
etsy_python/v3/common/Request.py 3 0 100%
etsy_python/v3/common/Utils.py 31 0 100%
etsy_python/v3/enums/HolidayPreferences.py 29 0 100%
etsy_python/v3/enums/Language.py 12 0 100%
etsy_python/v3/enums/Listing.py 78 0 100%
etsy_python/v3/enums/ListingInventory.py 6 0 100%
etsy_python/v3/enums/ProcessingProfile.py 7 0 100%
etsy_python/v3/enums/ShippingProfile.py 261 0 100%
etsy_python/v3/enums/ShopReceipt.py 12 0 100%
etsy_python/v3/exceptions/BaseAPIException.py 10 0 100%
etsy_python/v3/exceptions/RequestException.py 8 0 100%
etsy_python/v3/exceptions/__init__.py 2 0 100%
etsy_python/v3/models/FileRequest.py 7 0 100%
etsy_python/v3/models/HolidayPreferences.py 8 0 100%
etsy_python/v3/models/Listing.py 150 0 100%
etsy_python/v3/models/Miscellaneous.py 8 0 100%
etsy_python/v3/models/ProcessingProfile.py 21 0 100%
etsy_python/v3/models/Product.py 7 0 100%
etsy_python/v3/models/Receipt.py 39 0 100%
etsy_python/v3/models/Request.py 22 0 100%
etsy_python/v3/models/ShippingProfile.py 85 0 100%
etsy_python/v3/models/Shop.py 24 0 100%
etsy_python/v3/models/ShopReturnPolicy.py 25 0 100%
etsy_python/v3/models/Utils.py 19 0 100%
etsy_python/v3/models/__init__.py 10 0 100%
etsy_python/v3/resources/HolidayPreferences.py 19 0 100%
etsy_python/v3/resources/Listing.py 89 0 100%
etsy_python/v3/resources/ListingFile.py 22 0 100%
etsy_python/v3/resources/ListingImage.py 22 0 100%
etsy_python/v3/resources/ListingInventory.py 20 0 100%
etsy_python/v3/resources/ListingOffering.py 12 0 100%
etsy_python/v3/resources/ListingProduct.py 12 0 100%
etsy_python/v3/resources/ListingTranslation.py 19 0 100%
etsy_python/v3/resources/ListingVariationImages.py 16 0 100%
etsy_python/v3/resources/ListingVideo.py 22 0 100%
etsy_python/v3/resources/Miscellaneous.py 16 0 100%
etsy_python/v3/resources/Payment.py 23 0 100%
etsy_python/v3/resources/PaymentLedgerEntry.py 15 0 100%
etsy_python/v3/resources/ProcessingProfile.py 26 0 100%
etsy_python/v3/resources/Receipt.py 25 0 100%
etsy_python/v3/resources/ReceiptTransactions.py 27 0 100%
etsy_python/v3/resources/Response.py 9 0 100%
etsy_python/v3/resources/Review.py 16 0 100%
etsy_python/v3/resources/Session.py 94 0 100%
etsy_python/v3/resources/ShippingProfile.py 58 0 100%
etsy_python/v3/resources/Shop.py 23 0 100%
etsy_python/v3/resources/ShopProductionPartner.py 11 0 100%
etsy_python/v3/resources/ShopReturnPolicy.py 28 0 100%
etsy_python/v3/resources/ShopSection.py 25 0 100%
etsy_python/v3/resources/Taxonomy.py 23 0 100%
etsy_python/v3/resources/User.py 14 0 100%
etsy_python/v3/resources/UserAddress.py 19 0 100%
etsy_python/v3/resources/__init__.py 29 0 100%
etsy_python/v3/resources/enums/RateLimit.py 8 0 100%
etsy_python/v3/resources/enums/Request.py 7 0 100%

Updated by PR Tests

@amitray007
amitray007 merged commit 32a3602 into master Jul 30, 2026
6 checks passed
@amitray007
amitray007 deleted the fix/bumpversion-autosync branch July 30, 2026 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant