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.

Add --show option to print only the version number

See original GitHub issue

External tools currently have to use grep and sed to extract the version number from the output of bump2version --list.

bump2version --dry-run --list patch | grep current_version | sed -r s,"^.*=",,

This is long and not very readable. Worse yet, Windows doesn’t offer grep or sed unless you install Cygwin/GnuWin32/Linux subsystem for Windows[/…] .

Because it’s a common need, I’d like to see (and can contribute) this instead:

# print current version
>>> bump2version --show
2.11.3
# print current version with modified serialization
>>> bump2version --show --serialize "Release {major}.{minor} patchlevel {patch}."
Release 2.11 patchlevel 3.
# print 'next' (bumped) version
>>> bump2version patch --show
2.11.4

I would propose that show enforces dry-run behavior so it never touches physical files. If you want to physically bump the version and also show it, you simply have to call bump2version two times.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:5
  • Comments:18 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
florislacommented, Feb 7, 2020

Sorry it’s slow. I have a working branch but each time I want to make a pull request I’m not sure all the code in there is necessary or understandable.

I’ll aim for end of February for the pull request.

3reactions
tukatakacommented, Feb 6, 2020

@florisla Hello! It’s useful feature for me. Do you have estimation for it ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Video: More print options - Microsoft Support
Click in Copies and type the number of copies you want to print. Click the arrow next to the current printer and click...
Read more >
Solve printing problems on Mac - Apple Support
Click the printer in the Printers list on the right, click Options & Supplies, then check the Driver version. Contact with the printer...
Read more >
Command-Line Printing and Options - CUPS.org
The -p option specifies that you want to see a list of printers, and the -d option reports the current default printer or...
Read more >
Check Python version on command line and in script
This article describes how to check, get, and print the Python version installed and executed on Windows, Mac, and Linux.
Read more >
5.1. Using GHC — Glasgow Haskell Compiler 9.4.3 User's ...
First, create a file hello.hs containing the Haskell code: main = putStrLn "Hello, World!" ... Print a one-line string including GHC's version number....
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