Closed epicserve closed 1 month ago
Yes, unfortunately, this is a limitation of the current implementation. bumpver currently works line per line basis. There's a good deal to refactor, but I don't think it's impossible.
Do you have any interest/capacity to work on this?
Would there be less to refactor and less risk to breaking existing usages, it you added the ability to specify Regex flags in the pattern.
Maybe something like:
"uv.lock" = [
"/version = \"{version}\"/gmi",
]
Perhaps. In principle, for this issue, the \n
would be enough indication to treat the pattern differently.
"uv.lock" = [
'name = "bumpver-issue"\nversion = "{version}"',
]
However the multiline detection works, I'm doubtful there's an easy (i.e. hacky) way to make it work. The line by line logic is carried through so many places, I doubt you can make an isolated change.
Regarding capacity ... I was just checking this project out because a friend said he used it. I'm not even using it yet, so I don't really want to spend time on a fix. Right now, using the following in a Justfile is working for me.
@version_bump version:
sed -i '' 's/version = ".*"/version = "{{ version }}"/' pyproject.toml
uv sync
git add pyproject.toml uv.lock
git commit -m "Version bump to v{{ version }}"
just _success "Version bumped to v{{ version }}."
@mbarkhau, out of curiosity, why did you close it? UV is becoming more and more common and gaining a lot of traction as the preferred way to manage Python packages.
UV is incidental to the issue. The fundamental issue is this https://github.com/mbarkhau/bumpver/issues/193
A little bit related to https://github.com/astral-sh/uv/issues/6298
It seems like Bumver doesn't work with uv.lock files. I've also tried other patterns for the
uv.lock
file and I'm unable to find a pattern that works.Bumpver version: 2023.1129
I've also tried:
And:
And:
Steps to reproduce:
Change the
[tool.bumpver]
section inpyproject.toml
to:Then initialize Git:
Then bump the version:
Then run
git diff HEAD^ HEAD | cat
to see thatbumpver
changed all the versions off all the dependencies in theuv.lock
file instead of just the version for bumpver-issue.