Skip to content

Library is partially non-compliant with semver spec #114

@dbarella

Description

@dbarella

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateSame as another issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions