You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[sonic-package-manager] switch from poetry-semver to semantic_version due to bugs found in poetry-semver (sonic-net#1710)
#### What I did
I replaced underneeth a library which I used for semver functionality.
#### How I did it
Tried to keep existing Version/VersionConstraint API but replaced library used underneeth.
I also added two UT that failed with poetry-semver and show the motivation for this change.
UT description:
- ```test_invalid_version```
This test is to verify that **invalid** semantic version strings are rejected with exception by ```Version.parse```.
E.g. "1.2.3-0123" is not a valid semantic version due to this (https://semver.org/#spec-item-9):
```
A pre-release version MAY be denoted by appending a hyphen and a series of dot separated identifiers immediately following the patch version. Identifiers MUST comprise only ASCII alphanumerics and hyphens [0-9A-Za-z-]. Identifiers MUST NOT be empty. Numeric identifiers MUST NOT include leading zeroes
```
- ```test_version_comparison```
This test checks whether the implementation correctly compare two version strings (this is needed due to the logic that checks if we are upgrading or downgrading). According to https://semver.org/#spec-item-11, "1.0.0-alpha" < "1.0.0".
#### How to verify it
Run UT, run some basic sonic-package-manager commands.
0 commit comments