question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bumpversion fails when version is wrapped in quotes

See original GitHub issue

I have several applications that use bumpversion. The latest release has caused a breaking change. I have files like the following

.bumpversion.cfg

bumpversion]
current_version = 1.90.0
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)
commit = True
tag = True
message = "Bump version: {current_version} → {new_version} [ci skip]"
serialize = 
	{major}.{minor}.{patch}

[bumpversion:file:./version.sh]
search = CONF_VERSION={current_version}
replace = {new_version}

version.sh

CONF_VERSION='1.90.0'

when my build runs bumpversion minor it errors because it cannot find the version in the file version.sh I figured out the it is because the value in wrapped in single quotes. This worked fine in version 1.0.0 but is now broken in 1.0.1

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
balrokcommented, Oct 20, 2020

There was some breaking change. But it is still usable, just change your .bumpversion.cfg to:

[bumpversion:file:./version.sh]
search = CONF_VERSION='{current_version}'
replace = CONF_VERSION='{new_version}'

In my opinion the previous behavior sounds strange… maybe it did not find the search-string and then did fall back to the default search/replace?

1reaction
laszewskcommented, Oct 19, 2020

I just confirmed, bumpversion is no longer usable due to this error. I recommend that users use

bump2version==1.0.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bump2version fails with the new black code formatter #145
It formats all single quotes ' as double quotes ", which in turn causes ... [bumpversion:file:protoattend/__init__.py] search = __version__ ...
Read more >
Bump - Commitizen
Bump version. About. The version is bumped automatically based on the commits. ... use it in existing projects, wrap around simple quotes --bump-message ......
Read more >
Versioning using bumpversion - William Hayes, PhD
Bumpversion (use bump2version instead — it installs a command called ... 21, 23 — else you'll get an error message trying to run...
Read more >
Add permission API backend for macOS and iOS (Ic2a43e1a)
macOS: Ensure proper quoting when calling otool in objc_namespace script (Merged) ... Continuous Integration: Failed Failed to build sources.
Read more >
How to Publish an Open-Source Python Package to PyPI
Compared to the version currently published on PyPI, this version lacks some error handling and extra options.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found