your-tools / tbump

Bump software releases
BSD 3-Clause "New" or "Revised" License
158 stars 22 forks source link

include changes to `version.current` in patch diff #145

Closed dlqqq closed 1 year ago

dlqqq commented 2 years ago

When running tbump <version>, it's weird how the diff doesn't show the bump to version.current/tools.tbump.version.current in the patch diff. See here:

% tbump --dry-run 3.0.0
:: Bumping from 2.1.0.dev0 to 3.0.0
=> Would update current version in pyproject.toml
=> Would patch these files
- jupyter_server/_version.py:5 version_info = (2, 1, 0, ".dev", "0")
+ jupyter_server/_version.py:5 version_info = (3, 0, 0, "", "")
- pyproject.toml:7 version = "2.1.0.dev0"
+ pyproject.toml:7 version = "3.0.0"
- docs/source/conf.py:111 __version__ = "2.1.0.dev0"
+ docs/source/conf.py:111 __version__ = "3.0.0"
=> Would run these git commands
$ git add --update
$ git commit --message Bump to 3.0.0
$ git tag --annotate --message v3.0.0 v3.0.0
$ git push --atomic origin main v3.0.0

Note that the patch diff does not include the changes to the below line

[tool.tbump.version]
current = "0.2.0" # <<<

This is really confusing for new users, because I thought I had to add another file rule to specify this. It wasn't until I looked at the pyproject.toml in another repo (Jupyter server) that I noticed version.current is auto-bumped by tbump.

This should also be documented in the README. A quick search doesn't show any mention of version.current being auto-bumped by tbump, leaving it ambiguous as to whether users should do it themselves.

dmerejkowsky commented 2 years ago

This is really confusing for new users, because I thought I had to add another file rule to specify this.

Well, to be fair, there's a line that says the file is being updated:

=> Would update current version in pyproject.toml

But if you say you've been confused, I believe you :)

This should not be too hard to fix - do you want to try and work on a patch?

dmerejkowsky commented 1 year ago

So we kind of forgot about this bug because we add a buggy test - we probably need to fix the broken test first : #160

dmerejkowsky commented 1 year ago

Done in 26adb36