aboutcode-org / aboutcode-org/univers

Semver 2.0 != 2.0.0 and 2.0.0.0 is valid

Open
#16 1 comment 0 reactions 0 assignees View on GitHub
2-next documentation good first issue
Dominant language
Python
Stars
50
Forks
29
PR merge metrics
No merged PRs in 30d

Description

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.

```py
>>> 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
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.