forked from sonoble/sonic-buildimage
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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.
- Loading branch information
1 parent
7821a3f
commit 2c7cfaa
Showing
9 changed files
with
162 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters