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.

(not semver) Support for less than major.minor.patch

See original GitHub issue

Althoug semver states that m.m.p should be present. That does not mean it always is. Some software only gives a major or major.minor number. I would like semver to parse those numbers with minor or patch numbers defaulting to 0. That’s what is ment by those major only numbers anyway.

version = semver.parse('3.0') Should result in 3.0.0

version = semver.parse('10') Should result in 10.0.0

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:4
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
kxepalcommented, May 15, 2018
try:
    semver.parse(version)
except ValueError:
    return False
else:
    return True

If so.

1reaction
k-bxcommented, May 15, 2018

No, please make a separate function with an obvious name that it’s not Semver but something different. parse_relaxed might do

Read more comments on GitHub >

github_iconTop Results From Across the Web

Semantic Versioning 2.0.0 | Semantic Versioning
Semantic Versioning 2.0.0. Summary. Given a version number MAJOR.MINOR.PATCH, increment the: MAJOR version when you make incompatible API changes ...
Read more >
The terms MAJOR.MINOR.PATCH are not semantic · Issue #625
Problem Semver uses the historically significant terms MAJOR.MINOR.PATCH. While these terms are intuitive, they are not semantic.
Read more >
Semver doesn't mean major.minor.patch, it means fails ...
Using semver is a promise that if you make a backwards-incompatible change you will update the major version. That's entirely separate from any ......
Read more >
Major.Minor.Patch. An illustrated guide to semantic… - Medium
An illustrated guide to semantic versioning. TL;DR. A program's version does not represent the state of the software but makes a statement ...
Read more >
Maximum number for [major].[minor].[patch] - Stack Overflow
So, using the npm tools the maximum major, minor, patch in a semver is; 9007199254740991.9007199254740991.9007199254740991 .
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