Skip to content

Library is partially non-compliant with semver spec #114

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dbarella opened this issue Nov 25, 2018 · 5 comments
Closed

Library is partially non-compliant with semver spec #114

dbarella opened this issue Nov 25, 2018 · 5 comments
Labels
Duplicate Same as another issue

Comments

@dbarella
Copy link

dbarella commented Nov 25, 2018

Breaking input: 0.0.0-0foo.1

Expected result:

>>> import semver
>>> semver.parse('0.0.0-0foo.1')
{'build': None, 'major': 0, 'patch': 0, 'minor': 0, 'prerelease': '0foo.1'}

Actual result:

>>> import semver
>>> semver.parse('0.0.0-0foo.1')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.5/dist-packages/semver.py", line 65, in parse
    raise ValueError('%s is not valid SemVer string' % version)
ValueError: 0.0.0-0foo.1 is not valid SemVer string

Per item 9, only numeric IDs cannot contain leading zeros -- since 0foo is not entirely numeric, it may contain a leading zero.

@s-celles
Copy link
Member

I also understand it this way:

Numeric identifiers MUST NOT include leading zeroes.

so

Non numeric identifiers MAY include leading zeroes.

What is your opinion @k-bx ?

PR (with fix and test) are welcome @dbarella !

@sirzooro
Copy link

Any update on this? We use git commit hash as a prerelease part, so sometimes we trigger this error too.

@tomschr
Copy link
Member

tomschr commented Nov 20, 2019

If I'm not mistaken, it is related (or a duplicate?) of #194.

ppkt added a commit to ppkt/python-semver that referenced this issue Nov 20, 2019
…ersion from semver.org

Also, fix problem with invalid Python 2.7 super call.
ppkt added a commit to ppkt/python-semver that referenced this issue Nov 20, 2019
…ersion from semver.org

Also, fix problem with invalid Python 2.7 super call.
@sirzooro
Copy link

Yes, it is a duplicate. You can close this issue.

@tomschr tomschr added the Duplicate Same as another issue label Nov 21, 2019
@tomschr
Copy link
Member

tomschr commented Nov 21, 2019

Duplicate of #194 so closing.

@tomschr tomschr closed this as completed Nov 21, 2019
s-celles pushed a commit that referenced this issue Nov 24, 2019
Also, fix problem with invalid Python 2.7 super call.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate Same as another issue
Projects
None yet
Development

No branches or pull requests

4 participants