Quotation marks matter
See original GitHub issueI had version="0.2.0"
in my setup.py but when updating using bump2version patch it made version="version='0.2.0'"
Changing it to version='0.2.0'
did solve the problem for now
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:8
Top Results From Across the Web
Correct Usage of Quotation Marks in Academic Writing - Enago
Quotation marks are used to show that the text is taken word for word from another source, to call attention to an important...
Read more >Quotation Marks "" | Writing - EnglishClub
We use quotation marks to show (or mark) the beginning and end of a word or phrase that is somehow special or comes...
Read more >Single vs. Double Quotes: How & When to Use Quotation Marks
The preference for the single and double quotation marks is largely a matter of style. American writers will use double quotation marks to ......
Read more >Quotation Marks and Direct Quotations - University of Sussex
The use of quotation marks, also called inverted commas, is very slightly complicated by the fact that there are two types: single quotes...
Read more >When and how to use quotations in academic writing | Paperpal
One of the easiest punctuation marks that you can get wrong is quotation marks, also called inverted commas, quotes, or speech marks. Why?...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You are right that quotation marks matter.
But that’s fine – you may want it to match either single or double quotes, but not the other.
The problem is that supporting both quotation styles at the same time is hard to do –
search
does not accept regular expressions.I remember I’ve worked around this in the past, but I can’t seem to reproduce this at the moment. I probably included the quotation marks in the
parse
string in some way.For the record, here’s what’s causing the weird result:
Your
setup.py
contained double quotesversion="0.2.0"
but yoursearch
was looking for single quotesversion='{current_version}'
. Consequently, the search pattern did not match. (Unfortunately, this failure happens silently, even in verbose mode)In that case, Bump2version (silently) falls back to the default search, using the serialize pattern (in this case the default
{major}.{minor}.{patch}
). This resulted in a match on0.2.0
in the stringversion="0.2.0"
.It replaces the match with the new version, which you defined in
replace = version='{new_version}'
.So
version="0.2.0"
becomesversion="version='0.2.1'"
.Thanks for the explanation! I’m leaving this comment as a heads-up for users using the excellent black formatter, which changes single quotes into double quotes. So if you’re a user of
black
, you probably need to change the search/replace patterns in yourbumpversion.cfg
(orsetup.cfg
) to use"
instead of'
.