Skip to content

Semver 2.0 != 2.0.0 and 2.0.0.0 is valid #16

Open
@Hritik14

Description

@Hritik14

Code docs say
https://github.com/nexB/univers/blob/a52ea9900d87ef6cd0ed989bf20a41a794cf39c4/src/univers/versions.py#L177-L180

Even so, semver with more than 3 segments is treated as valid. This looks like an issue on the semantic_version side but we should not make false promises.

>>> from univers.versions import SemverVersion
>>> SemverVersion.is_valid("2")
True
>>> SemverVersion.is_valid("2.0")
True
>>> SemverVersion.is_valid("2.0.0")
True
>>> SemverVersion.is_valid("2.0.0.0")
True
>>> SemverVersion.is_valid("2.0.0.0.1")
True
>>> SemverVersion("2") == SemverVersion("2.0")
False
>>> SemverVersion("2.0.0") == SemverVersion("2.0")
False

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions