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.

A bit too aggro on the version parsing

See original GitHub issue

Hey there, love the work you’re doing to keep this alive

I’ve noticed, in my adventures setting up PEX builds for python apps, that any edition of bumpversion (bump2version, advbumpversion, etc) will aggressively match versions from setup.cfg in the listed files. In our case, setup.py is one of those files (normal stuff) and our install_requires can regularly list exact versions of other apps (abnormal but supported). Bumpversion likes to Loki it up in there.

Let’s say my setup.cfg looks like this, a real basic one:

>> cat setup.cfg 
[bumpversion]
current_version = 1.0.2
commit = False
tag = False
tag_name = {new_version}

[bumpversion:file:setup.py]

[bumpversion:file:myapp/__init__.py]

And my setup.py looks like this:

from setuptools import setup
__version__ = '1.0.2'

setup(
    name='myapp',
    version=__version__,
    install_requires=[
        'Flask==1.0.2'
    ]
    ...other useful irrelevant stuff....
)

If I run bumpversion on this project, it bumps the Flask version as well since it’s the same “version”, and causes our CICD to burst into flames.

What would it take to get a config/cli option for “keyword”? Like in setup.cfg, we can say what pattern our version follows, so it would be equally awesome to list a keyword that will always be found on the lines with the version, such as “version”, so bumpversion only replaces versions found on lines that contain the keyword.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

4reactions
florislacommented, Aug 2, 2018

I’ve read through the README again, and @jakethedev it seems there is feature that does what you want: search and replace.

I assume this should do the trick:

[bumpversion:file:setup.py]
search = __version__ = '{current_version}'
replace = __version__ = '{new_version}'
0reactions
jakethedevcommented, Aug 2, 2018

The golden fleece!

Awesome, thanks so much for looking into it!

Read more comments on GitHub >

github_iconTop Results From Across the Web

It sometimes makes me a bit sad when I take a parser around ...
For instance I just got out of a dungeon where my DRK tank did ... There is the stone sky sea dummy which...
Read more >
Tank Performance Tracking - Wrath of the Lich King Classic ...
I am parsing above 90 in raids and I would still say I am a below average tank, how much mitigation did I...
Read more >
Retribution Paladin Seal Twisting & Rotation In-Depth Guide
Retribution Paladin Seal Twisting & Rotation In-Depth Guide -- How to Parse 101 [WoW TBC Classic] · Chapters. View all · Chapters ·...
Read more >
Aggrokatz: pypykatz meets Cobalt Strike - SEC Consult
The current version of aggrokatz allows pypykatz to parse LSASS dump files and ... Despite pycobalt being a marvellous piece of engineering, ...
Read more >
How do I compare version numbers in Python? - Stack Overflow
packaging.version.parse is a third-party utility but is used by setuptools (so you probably already have it installed) and is conformant to ...
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